[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
- Previous message: [Python-Dev] bool(container) [was bool(iter([])) changed between 2.3 and 2.4]
- Next message: [Python-Dev] bool(container) [was bool(iter([])) changedbetween 2.3 and 2.4]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[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
- Previous message: [Python-Dev] bool(container) [was bool(iter([])) changed between 2.3 and 2.4]
- Next message: [Python-Dev] bool(container) [was bool(iter([])) changedbetween 2.3 and 2.4]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]