This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author twouters
Recipients
Date 2006-04-18.22:40:59
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.)
History
Date User Action Args
2007-08-23 15:48:24adminlinkissue1472639 messages
2007-08-23 15:48:24admincreate