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.

classification
Title: Allow range() to return long integer values
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: chadn, gvanrossum
Priority: normal Keywords: patch

Created on 2003-03-21 10:57 by chadn, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rangelong_python.patch chadn, 2003-03-21 11:04 Patch to bltinmodule.c and test_builtins.py
Messages (2)
msg43093 - (view) Author: Chad Netzer (chadn) Date: 2003-03-21 10:57
Extend range() builtin so that long integers may be
generated.
ie. range(10**20, 10**20 + 5)

New code path is only executed when normal code path
fails, to avoid slowing down the existing run path.
msg43094 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-04-11 19:01
Logged In: YES 
user_id=6380

Thanks; checked in. I made a number of changes to your
patch. One significant one: I changed things around so that
the "long" code now also gets invoked for a single argument;
that makes sure that range(-2**100) returns [] instead of
raising OverflowError. range(0, -2**100) already did the
right thing. I also collapsed the various Fail labels into
one, using XDECREF and initializing the pointer variables to
NULL.
History
Date User Action Args
2022-04-10 16:07:48adminsetgithub: 38194
2003-03-21 10:57:54chadncreate