[Python-3000] Removal of PyArg_Parse()
nnorwitz at gmail.com
Sat Aug 25 05:30:48 CEST 2007
On 8/24/07, Guido van Rossum <guido at python.org> wrote:
> On 8/24/07, skip at pobox.com <skip at pobox.com> wrote:
> > Guido> Are there any existing uses (in the core) that are hard to
> > Guido> replace with PyArg_ParseTuple()?
> > There are lots of uses where the arguments aren't tuples. I was
> > particularly vexed by the time module because it was used to extract
> > arguments both from tuples and from time.struct_time objects.
There are 45 uses in */*.c spread across 9 modules:
_hashopenssl.c (2), dbmmodule.c (4), gdbmmodule.c (2),
mactoolboxglue.c (5), stringobject.c (2)
with Python/mactoolboxglue.c looking like it's low hanging fruit, and
stringobject.c will hopefully go away. Some of the others don't look
bad. The bulk of the uses are in array and posixmodules. I'm not
sure if those are easy to change.
The remaining 65 uses are in Mac modules. I'm not sure if all of them
are sticking around. (That's a separate discussion we should
have--which of the mac modules should go.)
> > I suspect most of the low-hanging fruit (PyArg_Parse used to parse tuples)
> > has already been plucked.
I think this is mostly true, but there are still some that are
low-hanging. Maybe just kill the low hanging fruit for now.
> Then I don't think it's a priority to try to get rid of it, and maybe
> it should just stay.
I agree it's not the biggest priority, but it would be nice if it was
done. There's still over 500 uses of PyString which is higher
priority, but also probably harder in many cases.
More information about the Python-3000