[Python-Dev] Remove METH_OLDARGS? (original) (raw)

Neal Norwitz nnorwitz at gmail.com
Sun May 28 09:14:41 CEST 2006


On 5/28/06, Georg Brandl <g.brandl at gmx.net> wrote:

In the process of reviewing and possibly extending getargs.c, I stumbled over the "compatibility" flag supposedly used for METHOLDARGS 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.

The most important modules to fix from grep (and memory):

Modules/_sre.c: /* FIXME: use METH_OLDARGS instead of 0 or fix to use METH_VARARGS / Modules/_sre.c: / METH_OLDARGS is not in Python 1.5.2 */ Modules/_tkinter.c: {"call", Tkapp_Call, METH_OLDARGS}, Modules/_tkinter.c: {"globalcall", Tkapp_GlobalCall, METH_OLDARGS},Modules/_tkinter.c: {"merge", Tkapp_Merge, METH_OLDARGS},

$ grep -c METH_OLDARGS /.c | egrep -v :0 Modules/_sre.c:2 Modules/_tkinter.c:3 Modules/audioop.c:24 Modules/clmodule.c:19 Modules/flmodule.c:103 Modules/fmmodule.c:6 Modules/glmodule.c:430 Modules/svmodule.c:34 Objects/methodobject.c:2

I would like to get rid of the flag, but I'm not sure we can do it safely until 3.0.

n



More information about the Python-Dev mailing list