On 5/28/06, Georg Brandl <[EMAIL PROTECTED]> wrote:
> Neal Norwitz wrote:
> > On 5/28/06, Georg Brandl <[EMAIL PROTECTED]> wrote:
> >> In the process of reviewing and possibly extending getargs.c, I stumbled
> >> over the "compatibility" flag supposedly used for METH_OLDARGS functions.
> >> No code in the core uses this calling convention any more, and it has been
> >> deprecated for quite a long time (since 2.2), so would it be appropriate 
> >> to end
> >> support for it in 2.5?
> >
> > There's still a ton used under Modules.  Also, if no flag is
> > specified, it will default to 0 (ie, METH_OLDARGS).  I wonder how many
> > third party modules use METH_OLDARGS directly or more likely
> > indirectly.
>
> 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 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. :-)

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

n
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to