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/025018.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 00:07:36 +0200
Oren Tirosh <oren-py-d@hishome.net> writes:

>    ... why shouldn't an xrange have an xrangeiterator? 

Because that would create an additional object.

> It's the only way to make xrange behave consistently with other iterables.  

Why does it have to be consistent?

> I know it works just fine the way it is.  But I see a lot of confusion on 
> the python list around the semantics of iterators and this behavior might 
> make it just a little bit worse.

Why do you think people will get confused? Most people will use it in
the canoncical form

for i in range(maxvalue)

in which case they cannot experience any difference (except for the
performance boost)?

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