Super Tuples

Aahz Maruch aahz at netcom.com
Wed Dec 29 14:15:24 EST 1999


In article <84dh0i$17io$1 at nntp6.u.washington.edu>,
Donn Cave  <donn at u.washington.edu> wrote:
>
>I'm not too worried about the mathematicians, they'll probably be able
>to cope with the differences between their tuples and Python's, but
>there does seem to be a big gap between the tuple and class instance
>as ways to express the equivalent of a C struct.  The tuple is right
>for it, it's an efficient and ordered data structure, but the resulting
>programming idiom (access by index) is hard to read and prone to error.

There's one other problem with tuples: they are immutable, therefore
they can't mimic C structs.  It probably is the most Pythonic to come up
with a good idiom for classes or dicts that can easily mimic structs; I
usually use dicts for that purpose, myself.
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Eighth Virtual Anniversary -- 2 days and counting!



More information about the Python-list mailing list