On 27 Nov 2005 23:33:27 -0800, "Dan Bishop" <[EMAIL PROTECTED]> wrote:

>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):
>   ...
>
Seems like str.__mod__ could take an arbitary (BTW, matching length, 
necessarily?
Or just long enough?) iterable in place of a tuple, just like it can take
an arbitrary mapping object in place of a dict for e.g. '%(name)s'% 
{'name':'<name value>'}

Regards,
Bengt Richter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to