Author ezio.melotti
Recipients docs@python, eric.araujo, ezio.melotti, r.david.murray, terry.reedy, zach.ware
Date 2012-05-19.14:48:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337438935.28.0.968817112013.issue14840@psf.upfronthosting.co.za>
In-reply-to
Content
I think I liked the first version more, possibly with a few minor changes:

> Though tuples may seem very similar to lists, their immutability
> makes them ideal for fundamentally different usage.

I would drop the 'very', and I'm not sure that it's the immutability that enables this "fundamentally different" uses.

> In typical usage, tuples are a heterogenous structure, 
> whereas lists are a homogenous sequence.

Instead of "In typical usage" this could just be "Usually".

> This tends to mean that, in general, tuples are used
> as a cohesive unit while lists are used one member at a time.

This could even be dropped IMHO, or something could be said about index access (or attribute access in case of namedtuples) vs iteration.

Maybe something like this could work:
"""
Though tuples may seem similar to lists, they are often used in different situations and for different purposes.
Tuples are immutable, and usually contain an heterogeneous sequence of elements that are accessed via tuple-unpacking or indexing (or by attribute in the case of namedtuples).  [Sometimes tuples are also used as immutable lists.]
Lists are mutable, and their elements are usually homogeneous and are accessed by iterating on the list.
"""

FWIW homogeneous tuples are ok too, but here "homogeneous" is just a special case of "heterogeneous".  IMHO the main difference between lists and tuples is the way you access the elements (and homogeneous vs heterogeneous is just a side-effect of this); the fact that they are mutable or not is a secondary difference.
History
Date User Action Args
2012-05-19 14:48:55ezio.melottisetrecipients: + ezio.melotti, terry.reedy, eric.araujo, r.david.murray, docs@python, zach.ware
2012-05-19 14:48:55ezio.melottisetmessageid: <1337438935.28.0.968817112013.issue14840@psf.upfronthosting.co.za>
2012-05-19 14:48:54ezio.melottilinkissue14840 messages
2012-05-19 14:48:54ezio.melotticreate