[Python-Dev] bool(container) [was bool(iter([])) changedbetween 2.3 and 2.4] (original) (raw)

Raymond Hettinger raymond.hettinger at verizon.net
Fri Sep 30 18:25:01 CEST 2005


[Guido van Rossum]

len is for sequences and mappings specifically -- everything that supports getitem should have len and everything that has len should have getitem.

That's going a bit far. Unordered collections (like sets and bags) are a good counter-example.

Raymond



More information about the Python-Dev mailing list