21 Mar
2003
21 Mar
'03
6:55 a.m.
Hm, maybe range() shouldn't be an iterator but an interator generator. No time to explain; see the discussion about restartable iterators.
I think what you mean is fairly obvious. list et al. are iterator generators, right? It's just a thing with an __iter__ function which produces an iterator?
If so, I tend to agree that's the right behavior for range(). range(x,y,z) should be an immutable object.
Yes. Idioms like this are used fairly often: seq = range(...) for i in seq: ... for i in seq: ... # etc. --Guido van Rossum (home page: http://www.python.org/~guido/)