[Python-Dev] bool(iter([])) changed between 2.3 and 2.4 (original) (raw)
Raymond Hettinger raymond.hettinger at verizon.net
Thu Sep 22 07:12:10 CEST 2005
- Previous message: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py
- Next message: [Python-Dev] GIL, Python 3, and MP vs. UP
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Guido]
I strongly feel that this needs to be corrected in 2.5. Iterators should have neither len nor nonzero.
Right. I'll get it fixed-up.
[Terry Reedy]
I presume there were two reasons: internal efficiency of preallocations (list(someit) for example)
[Guido]
This could have been implemented without making the implementation details public.
I see a way to do that by renaming the len method to some private name for internal use. This would preserve the performance gains while still restoring the public API.
Raymond
- Previous message: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py
- Next message: [Python-Dev] GIL, Python 3, and MP vs. UP
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]