nested tuples

Terry Reedy tjreedy at udel.edu
Sat Sep 10 11:38:42 EDT 2005


"Luis P. Mendes" <luis_lupe2XXX at netvisaoXXX.pt> wrote in message 
news:3ofngkF5n00bU1 at individual.net...
> | Why?  What is it about the list of tuples that you don't like?
> | Philosophically, it's more in line with Guido's separation of list and
> | tuple.
> I'm not saying that I don't like, I was just curious to know if there
> was a way to do it using exclusively tuples.

A list of lists can be built top down.  A tuple of tuples must be built 
bottom up, and each tuple must be built with one call to tuple().  But 
tuple(it) will take any iterable, so write, say, a generator that yields 
lower-level tuples.

Terry J. Reedy






More information about the Python-list mailing list