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/2000-July/006468.html below:

[Python-Dev] [PEP204] Range Literals

[Python-Dev] [PEP204] Range Literals [Python-Dev] [PEP204] Range LiteralsPaul Prescod paul@prescod.net
Thu, 13 Jul 2000 17:48:39 -0500
Guido van Rossum wrote:
> 
> ..
> 
> It should be sweet and simple.  Make it return a list, just like
> range().  The whole point is that an optimizer can recognize that you
> are doing "for i in [0:10]: ...", and use a generator anyway -- but
> that's a thing for later to implement.

Why disallow this:

fives=[0:maxint:5]

As Fred points out, we've already got the underlying object
implementation in the src!

MAL also pointed out that immutable objects (like xranges) can be safely
precomputed and reused.

Finally, whatever the answer is, it should probably be the same as list
comprehensions.

-- 
 Paul Prescod - Not encumbered by corporate consensus
Simplicity does not precede complexity, but follows it. 
	- http://www.cs.yale.edu/~perlis-alan/quotes.html





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