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/2001-June/015568.html below:

[Python-Dev] xrange vs generators

[Python-Dev] xrange vs generatorsGuido van Rossum guido@digicool.com
Mon, 25 Jun 2001 10:26:08 -0400
> With generators in the language, should xrange be deprecated?
> 
> Skip

No, but maybe xrange() should be changed to return an iterator.
E.g. something like this:

  def xrange(start, stop, step):
      while start < stop:
          yield start
          start += stop

but with the appropriate defaults, and reversal of the test if step <
0, and an error if step == 0, and type checks enforcing ints (or long
ints!), and implemented in C. :-)

Although xrange() objects currently support some sequence algebra,
that is mostly bogus and I don't think anyone in their right mind uses
it.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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