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_bytes.py b/Lib/test/test_bytes.py
index f037d4c..0fd2f76 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -36,14 +36,14 @@
self.assertEqual(len(b), 0)
self.assertRaises(IndexError, lambda: b[0])
self.assertRaises(IndexError, lambda: b[1])
- self.assertRaises(IndexError, lambda: b[sys.maxint])
- self.assertRaises(IndexError, lambda: b[sys.maxint+1])
+ self.assertRaises(IndexError, lambda: b[sys.maxsize])
+ self.assertRaises(IndexError, lambda: b[sys.maxsize+1])
self.assertRaises(IndexError, lambda: b[10**100])
self.assertRaises(IndexError, lambda: b[-1])
self.assertRaises(IndexError, lambda: b[-2])
- self.assertRaises(IndexError, lambda: b[-sys.maxint])
- self.assertRaises(IndexError, lambda: b[-sys.maxint-1])
- self.assertRaises(IndexError, lambda: b[-sys.maxint-2])
+ self.assertRaises(IndexError, lambda: b[-sys.maxsize])
+ self.assertRaises(IndexError, lambda: b[-sys.maxsize-1])
+ self.assertRaises(IndexError, lambda: b[-sys.maxsize-2])
self.assertRaises(IndexError, lambda: b[-10**100])
def test_from_list(self):
@@ -83,14 +83,14 @@
def test_constructor_value_errors(self):
self.assertRaises(ValueError, bytearray, [-1])
- self.assertRaises(ValueError, bytearray, [-sys.maxint])
- self.assertRaises(ValueError, bytearray, [-sys.maxint-1])
- self.assertRaises(ValueError, bytearray, [-sys.maxint-2])
+ self.assertRaises(ValueError, bytearray, [-sys.maxsize])
+ self.assertRaises(ValueError, bytearray, [-sys.maxsize-1])
+ self.assertRaises(ValueError, bytearray, [-sys.maxsize-2])
self.assertRaises(ValueError, bytearray, [-10**100])
self.assertRaises(ValueError, bytearray, [256])
self.assertRaises(ValueError, bytearray, [257])
- self.assertRaises(ValueError, bytearray, [sys.maxint])
- self.assertRaises(ValueError, bytearray, [sys.maxint+1])
+ self.assertRaises(ValueError, bytearray, [sys.maxsize])
+ self.assertRaises(ValueError, bytearray, [sys.maxsize+1])
self.assertRaises(ValueError, bytearray, [10**100])
def test_repr_str(self):
@@ -412,7 +412,7 @@
self.assertRaises(TypeError, lambda: 3.14 * b)
# XXX Shouldn't bytes and bytearray agree on what to raise?
self.assertRaises((OverflowError, MemoryError),
- lambda: b * sys.maxint)
+ lambda: b * sys.maxsize)
def test_repeat_1char(self):
self.assertEqual(b'x'*100, bytearray([ord('x')]*100))