mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -99,12 +99,12 @@ class SliceTest(unittest.TestCase):
|
|||
def test_setslice_without_getslice(self):
|
||||
tmp = []
|
||||
class X(object):
|
||||
def __setslice__(self, i, j, k):
|
||||
tmp.append((i, j, k))
|
||||
def __setitem__(self, i, k):
|
||||
tmp.append((i, k))
|
||||
|
||||
x = X()
|
||||
x[1:2] = 42
|
||||
self.assertEquals(tmp, [(1, 2, 42)])
|
||||
self.assertEquals(tmp, [(slice(1, 2), 42)])
|
||||
|
||||
def test_pickle(self):
|
||||
s = slice(10, 20, 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue