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

M.-A. Lemburg mal at egenix.com
Tue Oct 26 11:31:41 CEST 2010

Antoine Pitrou wrote:
> Le lundi 25 octobre 2010 à 19:44 -0400, Eric Smith a écrit :
>> On 10/22/2010 6:45 PM, Antoine Pitrou wrote:
>>> On Sat, 23 Oct 2010 00:36:30 +0200
>>> "M.-A. Lemburg"<mal at egenix.com>  wrote:
>>>> It may seem strange to have functions, methods or object constructors
>>>> with more than 255 parameters, but as I said: when using code generators,
>>>> the generators don't care whether they use 100 or 300 parameters.
>>> Why not make the code generators smarter?

I don't see a way to work around the
limitation without starting every single wrapper object's .__init__()
with a test routine that checks the parameters in Python - and that's
not really feasible since it would kill performance.

You'd also have to move all **kws parameters to locals in order to
emulate the normal Python parameter invokation of the method.

>> Because it makes more sense to fix it in one place than force the burden 
>> of coding around an arbitrary limit upon each such code generator.
> Sure, but in the absence of anyone providing a patch for CPython, it is
> still a possible resolution.

Cesare already posted a patch based on using EXTENDED_ARG. Should we
reopen that old ticket or create a new one ?

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Oct 26 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the Python-ideas mailing list