giant stdlib tuples (was: Re: Help with code)

Quinn Dunkan quinn at schilling.ugcs.caltech.edu
Wed Feb 20 19:29:27 CET 2002


On Wed, 20 Feb 2002 08:41:31 -0500, Steve Holden <sholden at holdenweb.com> wrote:
>Besides the underscores another poster mentioned, note also that you have
>replaced a period with a comma. Your line which reads
>
>            self,dst=time.localtime(self.t)
>
>should read
>
>            self.dst=time.localtime(self.t)

Speaking of time.localtime() and giant tuple matches, I always wind up writing
my own wrappers for times and pwents so access them as proper objects.

It's always seemed to me that things like time, pwd, grp, and stat are pretty
non-pythonic.  You can't even really say it's because of the thin wrapper thing
because writing and using a StructType or something wouldn't be much harder
than using tuples.

Of course, I've learned to carry around my own little wrappers, but I've always
wondered why they were that way in the first place.



More information about the Python-list mailing list