PEP 276 Simple Iterator for ints (fwd)

James_Althoff at i2.com James_Althoff at i2.com
Thu Dec 6 17:12:28 EST 2001


David Eppstein wrote:
>But anyway, it would also be acceptable to me to use a syntax like
>"for i in lb < ... <= ub". This would also answer the other common
>objection that all for-loops must use "for var in iterator" syntax.
>I prefer the other syntax, because I think this one is verbose in a way
>that doesn't actually improve readability (verbosity that improves
>readability is better than conciseness, though).

I agree that

    i in lb < ... <= ub

is a bit more verbose without improving readability compared to

    lb < i <= ub

But, I see advantages in having "lb < ... <= ub" available as a
general-purpose way of creating an interval object, which could be handy
from time to time in some programs.

Jim





More information about the Python-list mailing list