diff -r 3430d7329a3b Doc/tutorial/datastructures.rst --- a/Doc/tutorial/datastructures.rst Thu May 17 17:37:02 2012 +0200 +++ b/Doc/tutorial/datastructures.rst Thu May 17 11:45:39 2012 -0500 @@ -366,6 +366,12 @@ effect with slicing and concatenation, though). It is also possible to create tuples which contain mutable objects, such as lists. +Though tuples may seem very similar to lists, their immutability makes them +ideal for fundamentally different usage. In typical usage, tuples are a +heterogenous structure, whereas lists are a homogenous sequence. This tends to +mean that, in general, tuples are used as a cohesive unit while lists are used +one member at a time. + A special problem is the construction of tuples containing 0 or 1 items: the syntax has some extra quirks to accommodate these. Empty tuples are constructed by an empty pair of parentheses; a tuple with one item is constructed by @@ -393,7 +399,6 @@ sequence. Note that multiple assignment is really just a combination of tuple packing and sequence unpacking. -.. XXX Add a bit on the difference between tuples and lists. .. _tut-sets: