Death to tuples!

Dan Bishop danb_83 at yahoo.com
Mon Nov 28 08:33:27 CET 2005


Mike Meyer wrote:
> It seems that the distinction between tuples and lists has slowly been
> fading away. What we call "tuple unpacking" works fine with lists on
> either side of the assignment, and iterators on the values side. IIRC,
> "apply" used to require that the second argument be a tuple; it now
> accepts sequences, and has been depreciated in favor of *args, which
> accepts not only sequences but iterators.
>
> Is there any place in the language that still requires tuples instead
> of sequences, except for use as dictionary keys?

The % operator for strings.  And in argument lists.

def __setitem__(self, (row, column), value):
   ...




More information about the Python-list mailing list