This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients larry
Date 2012-06-20.20:12:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340223161.28.0.941736214162.issue15118@psf.upfronthosting.co.za>
In-reply-to
Content
The trend in the standard library is to get rid of awkward Python-1-style tuple return values and switch to struct sequences.  (And perhaps, in the fullness of time, to deprecate the iterability of such objects.  But that's for the future.)

os.stat is a good example; it's much better to say s = os.stat() then refer to s.st_mtime than s[5] (or whatever the offset is).  And doing destructuring assignment... ptui!

I just noticed that the following functions in Modules/posixmodule.c still use BuildValue to build raw tuples:

_getdiskusage
_getfileinformation
forkpty
getloadavg
getresgid
getresuid
openpty
os2_error (can't get excited about this one)
pipe, pipe2
times
uname
wait, waitpid
wait3, wait4 (but one of the values is a struct sequence)

I think it'd be worthwhile to change all of these to struct sequences, sooner or later.

I realize we're almost out of time for 3.3, but perhaps we could hit the important ones (uname! times!) and get to the rest for 3.4?
History
Date User Action Args
2012-06-20 20:12:41larrysetrecipients: + larry
2012-06-20 20:12:41larrysetmessageid: <1340223161.28.0.941736214162.issue15118@psf.upfronthosting.co.za>
2012-06-20 20:12:40larrylinkissue15118 messages
2012-06-20 20:12:38larrycreate