f---ing typechecking

Donn Cave donn at u.washington.edu
Fri Feb 16 18:57:54 EST 2007


In article <7xfy956gq8.fsf at ruckus.brouhaha.com>,
 Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> Donn Cave <donn at u.washington.edu> writes:
> > Unpredictable?  How do you manage to write functions in this case?
> > Are all your formal parameter lists like (*a), with logic to deal
> > with the variable lengths?
> 
> I'm thinking of functions like printf, which take a variable number of
> args and don't assign them into variables by position.

I don't really see why you're thinking of them, but if
you look at how they do it, you'll see that they use some
run time magic to work as if they were written as conventional
functions.  This invariably involves some accessory data, like
printf's format string, that in effect tells the function its
parameter implementation at run time - including number of
parameters, since you can't tell even that from standard args
data as far as I know.  What this proves is that you can implement
an argument list at run time, but it by no means changes the
nature of the argument list as a sequence.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list