tuple question
Aahz Maruch
aahz at netcom.com
Wed Jun 14 11:34:29 EDT 2000
In article <3947255E.7CF77923 at softhome.net>,
etoffi <etoffi at bigfoot.com> wrote:
>
>admittedly this is a very [insert descriptive word here] question
>to ask, but what is a tuple and why is it used (as opposed to an
>array, etc).
>From my POV, the primary purpose of tuples is for dictionaries: they
allow you to do things like
foo = {}
foo[(1,2)] = 3
This essentially permits the use of multi-column primary keys (to use
database terminology). In addition, as Stephen Hansen pointed out,
tuples are a fair bit more efficient than lists.
--
--- Aahz (Copyright 2000 by aahz at netcom.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
"real love can't be explained by simplistic platitudes." --piranha
More information about the Python-list
mailing list