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/2011-September/113644.html below:

[Python-Dev] range objects in 3.x

[Python-Dev] range objects in 3.x [Python-Dev] range objects in 3.xGreg Ewing greg.ewing at canterbury.ac.nz
Sat Sep 24 01:25:11 CEST 2011
Ethan Furman wrote:

> The only reason I'm aware of at the moment is to prevent loss of 
> functionality from 2.x range to 3.x range.

Since 2.x range(...) is equivalent to 3.x list(range(...)), I don't
see any loss of functionality there.

Comparing range objects directly in 3.x is like comparing xrange
objects in 2.x, and there the comparison was arbitrary -- it
did *not* compare them like their corresponding lists:

Python 2.7 (r27:82500, Oct 15 2010, 21:14:33)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> a = xrange(5)
 >>> b = xrange(5)
 >>> a > b
True

-- 
Greg
More information about the Python-Dev mailing list

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