how to refactor nested for loop into smaller for loop assume each of them independent?

Random832 random832 at fastmail.com
Sat Oct 8 14:31:50 EDT 2016


On Sat, Oct 8, 2016, at 06:12, BartC wrote:
> The OP's code however is a good demonstration of how crazy Python's 
> original for-range loop was: you need to construct a list of N elements 
> just to be able to count to N. How many years was it until xrange was 
> introduced?

Python 1.4 had it, and that's the earliest version of the documentation
that exists on the website.

Python 1.0.1 does include rangeobject, with a timestamp on rangeobject.h
of 1994-01-01.

Python 0.9.1 does not.

So it was added some time between the original alt.sources posting
(February 1991) and version 1.0 (January 1994). And one could argue that
1.0 was the first "real" release of the language.

And of course, you were always free to write:

i = 0
while i < 999999:
    i = i + 1



More information about the Python-list mailing list