[Python-ideas] New 3.x restriction on number of keyword arguments

Cesare Di Mauro cesare.di.mauro at gmail.com
Fri Oct 22 09:18:01 CEST 2010


2010/10/21 Benjamin Peterson <benjamin at python.org>

> Georg Brandl <g.brandl at ...> writes:
>
> > You must be talking of a different restriction.
>
> I assumed Raymond was talking about calling a function with > 255 args.
>

I think that having max 255 args and 255 kwargs is a good and reasonable
limit which we can live on, and helps the virtual machine implementation
(and implementors :P).

Python won't lose its "power" and "generality" if one VM (albeit the
"mainstream" / "official" one) have some limits.

We already have some other ones, such as max 65536 constants, names, globals
and locals. Another one is the maximum 20 blocks for code object. Who thinks
that such limits must be removed?

I think that having more than 255 arguments for a function call is a very
rare case for which a workaround (may be passing a tuple/list or a
dictionary) can be a better solution than having to introduce a brand new
opcode to handle it.

Changing the current opcode(s) is a very bad idea, since common cases will
slow down.

Cesare
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20101022/a6a2039e/attachment.html>


More information about the Python-ideas mailing list