[Python-Dev] Remove METH_OLDARGS?

Georg Brandl g.brandl at gmx.net
Mon May 29 16:11:42 CEST 2006


Neal Norwitz wrote:

>> These modules can be converted.
> 
> We can convert the one's in Python, but not the third party ones.
> It's also very difficult to search for something that's not there.
> You need to review every PyMethodDef entry to verify it has a METH_*
> flag.  These implicit METH_OLDARGS may well exist in Python,
> especially given who did the patch to add them in the first place. :-)
> 
>     http://mail.python.org/pipermail/python-dev/2002-March/022009.html
>     http://mail.python.org/pipermail/patches/2002-July/009023.html

I'll gradually try to convert them.

>> > I would like to get rid of the flag, but I'm not sure we can do it
>> > safely until 3.0.
>>
>> It has been deprecated since 2.2, so it'd be no surprise if it went away.
> 
> There's a difference between "it'd be no surprise" and "it should be
> no surpise".  While I agree in theory they are the same, in practice,
> they are not.  That's the difference between theory and practice. :-)

Yep, you're right.

>> Also, it would be easy to detect METH_OLDARGS in PyCFunction_New and raise
>> an appropriate exception.
> 
> I agree with Martin this should raise a deprecation warning in 2.5.

Patch is at #1496957 (another one for converting Tkinter is at #1496952).

Georg



More information about the Python-Dev mailing list