bool(iter([])) changed between 2.3 and 2.4

Sept. 22, 2005
7:12 a.m.
[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]
[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
7113
Age (days ago)
7113
Last active (days ago)
0 comments
1 participants
participants (1)
-
Raymond Hettinger