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

MRAB python at mrabarnett.plus.com
Fri Oct 22 19:44:08 CEST 2010

On 22/10/2010 08:18, Cesare Di Mauro wrote:
> 2010/10/21 Benjamin Peterson <benjamin at python.org
> <mailto: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?
The BDFL thinks that 255 is too low.

> 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.

More information about the Python-ideas mailing list