mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Rip out 'long' and 'L'-suffixed integer literals.
(Rough first cut.)
This commit is contained in:
parent
fc7bb8c786
commit
e2a383d062
146 changed files with 1446 additions and 1477 deletions
|
@ -61,7 +61,7 @@ class BaseTest(unittest.TestCase):
|
|||
bi = a.buffer_info()
|
||||
self.assert_(isinstance(bi, tuple))
|
||||
self.assertEqual(len(bi), 2)
|
||||
self.assert_(isinstance(bi[0], (int, long)))
|
||||
self.assert_(isinstance(bi[0], (int, int)))
|
||||
self.assert_(isinstance(bi[1], int))
|
||||
self.assertEqual(bi[1], len(a))
|
||||
|
||||
|
@ -323,9 +323,9 @@ class BaseTest(unittest.TestCase):
|
|||
def test_getitem(self):
|
||||
a = array.array(self.typecode, self.example)
|
||||
self.assertEntryEqual(a[0], self.example[0])
|
||||
self.assertEntryEqual(a[0L], self.example[0])
|
||||
self.assertEntryEqual(a[0], self.example[0])
|
||||
self.assertEntryEqual(a[-1], self.example[-1])
|
||||
self.assertEntryEqual(a[-1], self.example[-1])
|
||||
self.assertEntryEqual(a[-1L], self.example[-1])
|
||||
self.assertEntryEqual(a[len(self.example)-1], self.example[-1])
|
||||
self.assertEntryEqual(a[-len(self.example)], self.example[0])
|
||||
self.assertRaises(TypeError, a.__getitem__)
|
||||
|
@ -338,7 +338,7 @@ class BaseTest(unittest.TestCase):
|
|||
self.assertEntryEqual(a[0], a[-1])
|
||||
|
||||
a = array.array(self.typecode, self.example)
|
||||
a[0L] = a[-1]
|
||||
a[0] = a[-1]
|
||||
self.assertEntryEqual(a[0], a[-1])
|
||||
|
||||
a = array.array(self.typecode, self.example)
|
||||
|
@ -346,7 +346,7 @@ class BaseTest(unittest.TestCase):
|
|||
self.assertEntryEqual(a[0], a[-1])
|
||||
|
||||
a = array.array(self.typecode, self.example)
|
||||
a[-1L] = a[0]
|
||||
a[-1] = a[0]
|
||||
self.assertEntryEqual(a[0], a[-1])
|
||||
|
||||
a = array.array(self.typecode, self.example)
|
||||
|
@ -777,7 +777,7 @@ class NumberTest(BaseTest):
|
|||
self.assertEqual(a[3::-2], array.array(self.typecode, [3,1]))
|
||||
self.assertEqual(a[-100:100:], a)
|
||||
self.assertEqual(a[100:-100:-1], a[::-1])
|
||||
self.assertEqual(a[-100L:100L:2L], array.array(self.typecode, [0,2,4]))
|
||||
self.assertEqual(a[-100:100:2], array.array(self.typecode, [0,2,4]))
|
||||
self.assertEqual(a[1000:2000:2], array.array(self.typecode, []))
|
||||
self.assertEqual(a[-1000:-2000:-2], array.array(self.typecode, []))
|
||||
|
||||
|
@ -863,8 +863,8 @@ class SignedNumberTest(NumberTest):
|
|||
|
||||
def test_overflow(self):
|
||||
a = array.array(self.typecode)
|
||||
lower = -1 * long(pow(2, a.itemsize * 8 - 1))
|
||||
upper = long(pow(2, a.itemsize * 8 - 1)) - 1L
|
||||
lower = -1 * int(pow(2, a.itemsize * 8 - 1))
|
||||
upper = int(pow(2, a.itemsize * 8 - 1)) - 1
|
||||
self.check_overflow(lower, upper)
|
||||
|
||||
class UnsignedNumberTest(NumberTest):
|
||||
|
@ -876,7 +876,7 @@ class UnsignedNumberTest(NumberTest):
|
|||
def test_overflow(self):
|
||||
a = array.array(self.typecode)
|
||||
lower = 0
|
||||
upper = long(pow(2, a.itemsize * 8)) - 1L
|
||||
upper = int(pow(2, a.itemsize * 8)) - 1
|
||||
self.check_overflow(lower, upper)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue