[Python-checkins] r42552 - in python/trunk: Lib/test/test_types.py Objects/intobject.c

georg.brandl python-checkins at python.org
Wed Feb 22 12:30:10 CET 2006


Author: georg.brandl
Date: Wed Feb 22 12:30:06 2006
New Revision: 42552

Modified:
   python/trunk/Lib/test/test_types.py
   python/trunk/Objects/intobject.c
Log:
RFE #1436243: make integers in [0..256] preallocated.



Modified: python/trunk/Lib/test/test_types.py
==============================================================================
--- python/trunk/Lib/test/test_types.py	(original)
+++ python/trunk/Lib/test/test_types.py	Wed Feb 22 12:30:06 2006
@@ -90,6 +90,10 @@
 if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
 else: raise TestFailed, 'float() does not work properly'
 print '6.4.1 32-bit integers'
+# Ensure the first 256 integers are shared
+a = 256
+b = 128*2
+if a is not b: raise TestFailed, '256 is not shared'
 if 12 + 24 != 36: raise TestFailed, 'int op'
 if 12 + (-24) != -12: raise TestFailed, 'int op'
 if (-12) + 24 != 12: raise TestFailed, 'int op'

Modified: python/trunk/Objects/intobject.c
==============================================================================
--- python/trunk/Objects/intobject.c	(original)
+++ python/trunk/Objects/intobject.c	Wed Feb 22 12:30:06 2006
@@ -62,7 +62,7 @@
 }
 
 #ifndef NSMALLPOSINTS
-#define NSMALLPOSINTS		100
+#define NSMALLPOSINTS		257
 #endif
 #ifndef NSMALLNEGINTS
 #define NSMALLNEGINTS		5


More information about the Python-checkins mailing list