Removed PyInt_GetMax and sys.maxint
I replaced sys.maxint with sys.maxsize in Lib/*.py. Does anybody see a problem with the change on Win 64bit platforms? Win 64's long is just 32bit but the sys.maxsize is now 2**63-1 on every 64bit platform.
Also added docs for sys.maxsize.
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index cc490d7..4979f92 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -194,24 +194,24 @@
def test_unary_minus(self):
# Verify treatment of unary minus on negative numbers SF bug #660455
- if sys.maxint == 2147483647:
+ if sys.maxsize == 2147483647:
# 32-bit machine
all_one_bits = '0xffffffff'
self.assertEqual(eval(all_one_bits), 4294967295)
self.assertEqual(eval("-" + all_one_bits), -4294967295)
- elif sys.maxint == 9223372036854775807:
+ elif sys.maxsize == 9223372036854775807:
# 64-bit machine
all_one_bits = '0xffffffffffffffff'
self.assertEqual(eval(all_one_bits), 18446744073709551615)
self.assertEqual(eval("-" + all_one_bits), -18446744073709551615)
else:
self.fail("How many bits *does* this machine have???")
- # Verify treatment of contant folding on -(sys.maxint+1)
+ # Verify treatment of contant folding on -(sys.maxsize+1)
# i.e. -2147483648 on 32 bit platforms. Should return int, not long.
- self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int))
- self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), int))
+ self.assertTrue(isinstance(eval("%s" % (-sys.maxsize - 1)), int))
+ self.assertTrue(isinstance(eval("%s" % (-sys.maxsize - 2)), int))
- if sys.maxint == 9223372036854775807:
+ if sys.maxsize == 9223372036854775807:
def test_32_63_bit_values(self):
a = +4294967296 # 1 << 32
b = -4294967296 # 1 << 32