Lists, tuples and memory.

Arthur ajsiegel at optonline.com
Fri Jul 16 10:03:13 EDT 2004


On Thu, 15 Jul 2004 15:52:53 -0400, Christopher T King
<squirrel at WPI.EDU> wrote:

>
>
>1) Stick with lists.  Tuples are meant to be used not really as immutable
>lists, but as a way to group related items of different types.  e.g. the
>sequence 'apple','orange','pear','banana' should be stored in a list,
>whereas the group of related items 'apple','red',3,5 (presumably
>describing an apple in some predefined manner, say,
>fruit,color,width,height) should be stored in a tuple.  At least that's 
>what Guido wants us to do. ;)

But with Fletcher's confession of sticking with tabs ... its anarchy
out there.

>
>2) Assuming you're using a newer version of Python, try using a list 
>comprehension instead of map().  It's a little bit cleaner, and will 
>probably be a bit faster too:

Faster is good.

Modern and progessive governance. The tax incentive concept at work.

Art



More information about the Python-list mailing list