PEP 276 -- What else could iter(5) mean?
Delaney, Timothy
tdelaney at avaya.com
Wed Mar 6 18:11:48 EST 2002
> From: James_Althoff at i2.com [mailto:James_Althoff at i2.com]
>
> [Bernhard Herzog]
> > That's not quite right, I think :)
> >
> > [f(x)
> > for x in range((4 in range(3)) in range((2 in range(3))))
> > if x in range((x+1 in range(x*2)))]
> >
> > would me more like it (but it's late so there may still be
> a mistake :) )
>
> Thanks (I think <wink>).
>
>
> [James Althoff]
> > Can you suggest a less contrived example that might be a problem?
> [Bernhard Herzog]
> > x, = 1
> >
> > would assign 0 to x instead of raising an error.
>
> Agreed. Note that this example has been in the PEP from the
> beginning.
And in my opinion would be something that should be checked by PyChecker ...
Tim Delaney
More information about the Python-list
mailing list