PEP 276 -- What else could iter(5) mean?

John Roth johnroth at ameritech.net
Thu Mar 7 19:31:34 EST 2002


"Justin Sheehy" <justin at iago.org> wrote in message
news:mailman.1015517623.2914.python-list at python.org...
> Bernhard Herzog <bh at intevation.de> writes:
>
> > Do we really want all of these new behaviors?
>
> No.  Please, no.
>
> I still don't see what this proposal provides in terms of a real gain
> in order to offset the obvious potential for ugliness, mistakes, and
> the appearance of ambiguity.
>
> Not having to type "range" or "xrange" doesn't count as a real gain.
>
> The PEP describes having to use range in this context as a wart, but I
> don't remember it ever being referred to as such before this PEP.

I suspect whether it is or not depends on your frame of reference,
that is, what languages you came from. My background includes
Fortran long before anybody ever thought of C, so to me the for loop
is slightly bizzare: iteration over a monotonic sequence of integers
should be simpler. Python implements a much more useful general
case, at the expense of making the special case a bit more difficult.

I'm against the proposal, simply on the basis that I don't find
5.iter to have a blindingly obvious meaning. It's ok if you explain
it, but it's still not obvious that it's anything but a special case
hack.

Range (and xrange) at least have the advantage that, once
explained, they fit into the scheme of things nicely.

John Roth
>
> -Justin
>
>
>
>





More information about the Python-list mailing list