[Python-Dev] Remove METH_OLDARGS?
"Martin v. Löwis"
martin at v.loewis.de
Tue May 30 07:45:02 CEST 2006
Neal Norwitz wrote:
> How can users find the implicit use of METH_OLDARGS in code like this:
>
> static struct PyMethodDef gestalt_methods[] = {
> {"gestalt", gestalt_gestalt},
> {NULL, NULL} /* Sentinel */
> };
>
> static PyMethodDef SwiMethods[]= {
> { "swi", swi_swi,0},
> { NULL, NULL}
> };
They can't know they do. Of course, if they do, they likely also use
PyArg_Parse to process the arguments.
> OTOH, perhaps a deprecation warning on PyArgs_Parse() is sufficient?
> What about that? It doesn't address other cases where OLDARGS are
> used without PyArgs_Parse though.
What other cases remain? People might have complex argument processing
procedure not involving PyArg_Parse, these would just break with a
runtime error in Py3k. If the module is maintained, it should be easy
to fix it. If the module is unmaintained, producing a warning now
might not help, either.
Regards,
Martin
More information about the Python-Dev
mailing list