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.

Unsupported provider

classification
Title: Extend pre-allocated integers to cover [0, 255]
Type: enhancement Stage:
Components: None Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, rhettinger, tcdelaney, terry.reedy
Priority: normal Keywords:

Created on 2006-02-21 22:43 by tcdelaney, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg54735 - (view) Author: Tim Delaney (tcdelaney) Date: 2006-02-21 22:43
When the `bytes` object is introduced (successor to 
PEP 332) the full range of byte integer objects [0, 
255] are likely to be used more commonly.

Suggest extending the pre-allocated integer obejcts to 
include the full range [0, 255].
msg54736 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2006-02-21 22:47
Logged In: YES 
user_id=80475

Georg, would you take care of this one for Py2.5.
Also include the value 256.
msg54737 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2006-02-22 06:38
Logged In: YES 
user_id=593130

I decided to test out the new svn view facility ;-)

Looks like 100 in
#define NSMALLPOSINTS		100
in python/trunk/Objects/intobject.c
just needs to be upped to 257

Unlike for other builtin types, I could not find a 
Lib/test/test_int.py file or equivalent where ints are 
tested, to see if pre-allocation is tested.  What did I 
miss?
msg54738 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-02-22 11:30
Logged In: YES 
user_id=849994

It's test_types, and I added a test too.

Revision 42552.
msg54739 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2006-02-22 18:04
Logged In: YES 
user_id=593130

Thanks for the info.  Small nit: your checkin message says
"RFE #1436243: make integers in [0..256] preallocated. "
The range is actually (now)[-5...256].
#define NSMALLNEGINTS		5
sets the lower limit (unchanged).
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42933
2006-02-21 22:43:30tcdelaneycreate