python loops

Nicko usenet at nicko.org
Mon Sep 4 06:37:16 EDT 2006


Steve Holden wrote:
> Nicko wrote:
> > Fredrik Lundh wrote:
> >>if you cannot refrain from pulling arguments out of your ass, you not
> >>really the right person to talk about hygiene.
> >
> > I'm impressed but your mature argument. Clearly, in the face of such
> > compelling reasoning, I shall have to concede that we should all
> > generate our range lists up front.
> >
> I'm impressed that you think any of this will be news to the effbot,
> whose sagacity is exceeded only by his irritability in the face of
> ignorance.

Well, I may not have written as much "award winning" Python software as
Fredrik, but sagacity usually implies wisdom and good judgement rather
than mere knowledge.  Still I'm hard pressed to see why suggesting
that, when I want to iterate a number of times, I should use an
iterator that goes around a number of times (and appreciate the bounded
storage requirements that result) rather than writing down the list of
numbers and then selecting each in turn, should warrant such an
outburst.

One wonders if the authors of PEP 3100, the outline plans Python 3.0,
are all premature optimisation freaks too. After all it states that
sooner or later the built in range function will return an iterator and
those of us who prefer to iterate rather than count on our
fingers/lists will have yet another optimisation; we'll not need to put
an "x" in front of our ranges.

Nicko




More information about the Python-list mailing list