22 Sep
2005
22 Sep
'05
3:14 a.m.
On 9/21/05, Raymond Hettinger
[Guido van Rossum]
Could you at least admit that this was an oversight and not try to pretend it was intentional breakage?
Absolutely. I completely missed this one.
Thanks; spoken like a man. I strongly feel that this needs to be corrected in 2.5. Iterators should have neither __len__ nor __nonzero__. I see mostly agreement that this is a misfeature. We don't really want to start writing code like this: while it: x = it.next() ...process x... when we can already write it like this: for x in it: ...process x... do we? Keeping a special API to allow a more efficient implementation of __reversed__ is fine. -- --Guido van Rossum (home page: http://www.python.org/~guido/)