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

Quinn Dunkan quinn at regurgitate.ugcs.caltech.edu
Thu Feb 21 14:00:11 EST 2002


On Thu, 21 Feb 2002 11:35:37 GMT, Michael Hudson <mwh at python.net> wrote:
>quinn at schilling.ugcs.caltech.edu (Quinn Dunkan) writes:
>> 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.
>
>Used Python 2.2 yet?

Aha!  I hadn't seen this one advertised anywhere, and they disguise themselves
as tuples.  pwd and grp still don't return structs, but it's a good start.

Deserves more advertisement, I think:

The days of 'os.stat(fn)[stat.ST_BLAH]' are over.

I still wonder about those wacky C structure names, though.  Did they think
people would forget what kind of structure they were asking about after they
typed the '.'?



More information about the Python-list mailing list