[Python-Dev] PyArg_ParseTuple vs. PyArg_Parse

Neal Norwitz neal@metaslash.com
Tue, 30 Jul 2002 08:19:20 -0400


Just van Rossum wrote:
> 
> nnorwitz@users.sourceforge.net wrote:
> 
> > Use PyArg_ParseTuple() instead of PyArg_Parse() which is deprecated
> >
> > Index: posixmodule.c
> > ===================================================================
> [ ... ]
> > !     else if (!PyArg_Parse(arg, "(ll)", &atime, &mtime)) {
> [ ... ]
> > !     else if (!PyArg_ParseTuple(arg, "ll", &atime, &mtime)) {
> [ ... ]
> 
> Probably no biggie here, but I'd like to point out that there is a significant
> difference between the two calls: the former will allow any sequence for 'arg',
> but the latter insists on a tuple. For that reason I always use PyArg_Parse() to
> parse coordinate pairs and the like: it greatly enhanced the usability in those
> cases. Examples of this usage can be found in the Mac subtree.

I'll back out this change.  But this raises the question should 
PyArg_Parse() be deprecated or should just METH_OLDARGS be deprecated?

Neal