mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Remove the simple slicing API. All slicing is now done with slice objects.
This commit is contained in:
parent
582b586617
commit
d2cf20eea2
32 changed files with 78 additions and 810 deletions
|
@ -283,17 +283,6 @@ class LongTest(unittest.TestCase):
|
|||
self.assert_(type(y) is int,
|
||||
"overflowing int conversion must return long not long subtype")
|
||||
|
||||
# long -> Py_ssize_t conversion
|
||||
class X(object):
|
||||
def __getslice__(self, i, j):
|
||||
return i, j
|
||||
|
||||
self.assertEqual(X()[-5:7], (-5, 7))
|
||||
# use the clamping effect to test the smallest and largest longs
|
||||
# that fit a Py_ssize_t
|
||||
slicemin, slicemax = X()[-2**100:2**100]
|
||||
self.assertEqual(X()[slicemin:slicemax], (slicemin, slicemax))
|
||||
|
||||
# ----------------------------------- tests of auto int->long conversion
|
||||
|
||||
def test_auto_overflow(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue