[Python-Dev] Re: [Python-checkins] python/dist/src/Modules posixmodule.c,2.247,2.248

Just van Rossum just@letterror.com
Tue, 30 Jul 2002 07:55:20 +0200


nnorwitz@users.sourceforge.net wrote:

> Update of /cvsroot/python/python/dist/src/Modules
> In directory usw-pr-cvs1:/tmp/cvs-serv31715/Modules
> 
> Modified Files:
>   posixmodule.c 
> Log Message:
> 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.

Just