PEP 276 Simple Iterator for ints (fwd)

David Eppstein eppstein at ics.uci.edu
Wed Nov 28 02:18:46 EST 2001


In article <3C048CCC.6A8C3743 at engcorp.com>,
 Peter Hansen <peter at engcorp.com> wrote:

> > -- but I would be interested in changes that allow
> > non-Python-literate programmers to understand my code without having to
> > dig through a manual.
> 
> I agree that sounds like a worthy goal.  I disagree that your
> suggestion is any more likely to be understood by anyone,
> other than perhaps a mathematician.  As a very experienced
> programmer, I found it quite obscure and am unsure I 
> would have figured it out were it not for the context of
> recent threads on the subject.

>From context, it seems you mean Ewing's suggestion rather than mine, right?

> Maybe we should look back to BASIC (for i = 1 to 5: next) 
> or one of the suggestions for something which looks more 
> explicitly like a list of items (for i in [0..5]) or 
> (for i in [0, 1, .. 5] ).  Especially this latter would
> definitely be understandable to anyone, IMHO.

Your final option is very close to my suggestion, much earlier in this 
thread, which seems to be disliked by many due to its requiring closed 
intervals while other Python features use half-open ones.
-- 
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