[Patches] [ python-Patches-707427 ] Allow range() to return long integer values

SourceForge.net noreply@sourceforge.net
Fri, 11 Apr 2003 12:01:48 -0700


Patches item #707427, was opened at 2003-03-21 05:57
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=707427&group_id=5470

Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Chad Netzer (chadn)
Assigned to: Nobody/Anonymous (nobody)
Summary: Allow range() to return long integer values

Initial Comment:
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.


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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2003-04-11 15:01

Message:
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.

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

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