and [True,True] --> [True, True]?????

"Martin v. Löwis" martin at v.loewis.de
Fri Apr 24 14:21:42 EDT 2009


>> Of course dicts and sets are sequences.  But there are also sequences
>> on which len doesn't work.
> 
> That was my intuition, too. But Python takes a different stance:

It's a sequence if it can be indexed by numbers in range(len(seq)).
Neither dicts nor sets can be indexed that way.

Regards,
Martin



More information about the Python-list mailing list