[Python-Dev] bool(iter([])) changed between 2.3 and 2.4
Delaney, Timothy (Tim)
tdelaney at avaya.com
Wed Sep 21 01:23:53 CEST 2005
Fred L. Drake, Jr. wrote:
> On Tuesday 20 September 2005 17:49, Guido van Rossum wrote:
> > I realize that this was a deliberate feature, and that it exists in
> > 2.4 as well as in 2.4.1 and will in 2.4.2; yet, I'm not sure I
> *like*
>
> I wasn't paying any attention at the time, so I don't know what was
> discussed. Some discussion here just now leads me to believe that at
> least two of us here (including myself) think iterators shouldn't
> have length at all: they're *not* containers and shouldn't act that
> way.
In any case, it's simple to get the 2.3 behaviour back - just add
__nonzero__. I think that could validly be considered a bugfix.
Tim Delaney
More information about the Python-Dev
mailing list