[Patches] [ python-Patches-1472639 ] make range be xrange

SourceForge.net noreply at sourceforge.net
Thu Dec 28 02:39:13 CET 2006


Patches item #1472639, was opened at 2006-04-18 18:40
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1472639&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Thomas Wouters (twouters)
Assigned to: Neal Norwitz (nnorwitz)
Summary: make range be xrange

Initial Comment:
As discussed (in private email), make range an alias
for xrange and see howmuch breaks ;)

Aside from Python/bltinmodule.c, 31 files had to be
changed: 3 modules (but one of them was a doctest in
doctest), 2 test output files (for profile and
cProfile), and 26 tests. The predominant breakage in
tests was due to tests using range() to express
expected-test-output, and comparing it with the output
list. Another fair sized portion (particularly of
doctests, and including the doctest in doctest itself
that had to be updated) broke because of reliance on
the repr of range(). Only a few tests broke because of
xrange() being immutable (mostly tests that were
actually testing list-behaviour, like item- and
slice-assignment, on a list created by range()), but
that were all two real breakages in actual modules. The
only place that broke because xrange can't handle longs
was the test for range() that tested whether it'd take
longs. Overall, ~185 lines had to be changed.

The patch still breaks a test: the test to see if
range() does proper checks on its arguments (using the
'badint' class in test_builtin.) I didn't fix it to
remind myself that xrange() should be made to operate
on longs :) (It currently fails because xrange() will
turn all its arguments into C long integers before it
does any checks.)


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2006-12-27 20:39

Message:
Logged In: YES 
user_id=6380
Originator: NO

Ping?

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2006-08-26 16:20

Message:
Logged In: YES 
user_id=6380

For Neal to close when his range/xrange patch is uploaded.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1472639&group_id=5470


More information about the Patches mailing list