com_addbyte

Michael Hudson mwh21 at cam.ac.uk
Wed Nov 1 12:58:51 EST 2000


etsang at my-deja.com writes:

> Hi all,
> 
> Since I am not entitled to display source code outside, I am not able
> to give the source code out. But here is something that I have found:
> 
> there is a function which takes in more than 255 parameters, and once
> that number of parameters are reduced, Python does not complain anymore.
> 
> So is there a way to get around that?

Note that the problem is at the call site.  You can perfectly happily
define functions with 1000 parameters (I've just tried it...), but you
can't call it like:

f(arg0,arg1,...,arg1000)

call it like this instead:

f(*(arg0,arg1,...,arg1000))

or (if you're stuck with 1.5.2):

apply(f,(arg0,arg1,...,arg1000))

(if you're machine-generating the code, this shouldn't be too hard).

HTH,
M.

-- 
  Java is a WORA language! (Write Once, Run Away)
                	-- James Vandenberg (on progstone at egroups.com)
                           & quoted by David Rush on comp.lang.scheme



More information about the Python-list mailing list