python gripes survey
Skip Montanaro
skip at pobox.com
Mon Aug 25 16:49:23 EDT 2003
josh> And arguably easier to deal with than Python in that the fields
josh> are named. I think that's all Afanasiy was getting at.
Yeah, that was my impression as well. Note that there is a "super tuple"
type used in some places in the Python C code which allows both positional
and attribute access to fields:
>>> import time
>>> t = time.localtime()
>>> t
(2003, 8, 25, 15, 45, 46, 0, 237, 1)
>>> t.tm_year
2003
>>> type(t)
<type 'time.struct_time'>
I don't know if the in-memory storage is more like a tuple or more like a
dict.
Exposing something like this to the Python programmer was suggested a few
years ago. I don't recall why it wasn't adopted, though any obvious reason
might be that it's fairly easy to create container classes for that purpose.
Skip
More information about the Python-list
mailing list