PEP 276 Simple Iterator for ints (fwd)

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Dec 4 00:24:49 EST 2001


Marcin 'Qrczak' Kowalczyk wrote:
> 
>     i = 0
>     while i < 10:
>         print i
>         i += 1
> 
> There is another question: should the upper bound be reevaluated each
> time?

I'd say no. Most of the time I wouldn't want that,
and would object to paying for it when I didn't
need it. When I wanted it, I'd write a while loop.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list