Status of PEP's?

David Eppstein eppstein at ics.uci.edu
Fri Mar 1 11:21:04 EST 2002


In article <mailman.1014990243.30815.python-list at python.org>,
 "Bjorn Pettersen" <BPettersen at NAREX.com> wrote:

> Nothing at all, but with this syntax you have different semantics for:
> 
>    for start <= i < end:
> 
> And
> 
>    if start <= i < end:

Different in what sense?

"for something" loops over all values of the variable that make "something" 
true.  Which part of "something" is the variable is determined by its 
location in the overall expression.

That is true with the current "for x in y" syntax as well as
the suggested "for start <= i < end" syntax.
Well, except that by "all values" substitute "all integer values"
since it doesn't make sense to loop over all floats.
-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/



More information about the Python-list mailing list