A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025026.html below:

[Python-Dev] xrange identity crisis

[Python-Dev] xrange identity crisis [Python-Dev] xrange identity crisisMartin v. Loewis martin@v.loewis.de
05 Jun 2002 09:30:05 +0200
Guido van Rossum <guido@python.org> writes:

> Is it really so bad if this allocates *two* objects instead of one?

When accepting the patch, I assumed that the observed speed difference
between xrange and range originated from the fact that xrange
iteration allocates iterator objects. I'm not so sure anymore that
this is the real cause, more likely, it is again the exception
handling when exhausting the range.

> I think that's the only to get my example to work correctly.  And it
> *has* to work correctly.
> 
> If two objects are created anyway, I agree with Oren that it's better
> to have a separate range-iterator object type.

I agree. I wouldn't mind if somebody would review Raymond's to
introduce such a thing.

Regards,
Martin





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4