"Tuples are for heterogeneous data, lists are for homogeneous data."

Raymond Hettinger vze4rx4y at verizon.net
Wed Mar 12 05:06:08 CET 2003

"Erik Max Francis" <max at alcyone.com> wrote in message
news:3E6EA691.E0E30AFC at alcyone.com...
> Arthur wrote:
> > The subject line is a Guido quote from today's dev list.
> >
> > Is the point Guido making performance related, or is it something
> > else? I
> > have used lists extensively for heterogenous data, and wonder what it
> > is I
> > am losing by so doing.
> Nothing, it's just a style guideline.  I'm aware of no optimizations
> that would provide a penalty for not using lists/tuples in this way.

It's a bit more than a style guideline, it reflects Guido's design intent
and is reflected in design decisions throughout python.  That is why
tuples don't have index() or count() methods.

Raymond Hettinger

More information about the Python-list mailing list