Status of PEP's?
greg at cosc.canterbury.ac.nz
Mon Mar 4 01:15:41 CET 2002
James_Althoff at i2.com wrote:
> if I want to iterate up (smaller up to larger) I need to
> write the for-loop as
> for smaller <= i <= larger: # can *only* iterate up
> but if I want to iterate down (larger down to smaller) I need to write the
> for-loop with the reverse relational operators
> for larger >= i >= smaller: # can *only* iterate down
Sorry, I missed that you wanted the order of iteration
to be variable. You're right, but I don't see that as
a major disadvantage. The vast majority of all for-loops
over integers that I write have a fixed iteration order.
In the rare cases that I wanted otherwise, I'd be
quite happy to write the loop another way.
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
More information about the Python-list