lists v. tuples

castironpi at gmail.com castironpi at gmail.com
Tue Mar 18 17:27:44 EDT 2008


> > > On Mar 17, 1:31 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
>
> > >> A common explanation for this is that lists are for homogenous
> > >> collections, tuples are for when you have heterogenous collections i.e.
> > >> related but different things.
>
> > > I interpret this as meaning that in a data table, I should have a list
> > > of records but each record should be a tuple of fields, since the
> > > fields for a table usually have different forms whereas the records
> > > usually all have the same record layout.
>
> >>> b in b
> False

That's actually interesting.

>>> a= []
>>> a.append( a )
>>> a
[[...]]
>>> a in a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded in cmp



More information about the Python-list mailing list