MCPcopy Index your code
hub / github.com/python/cpython / test_setslice_without_getslice

Method test_setslice_without_getslice

Lib/test/test_slice.py:234–242  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

232 self.assertEqual(slice(0, 10, 1).indices(MyIndexable(5)), (0, 5, 1))
233
234 def test_setslice_without_getslice(self):
235 tmp = []
236 class X(object):
237 def __setitem__(self, i, k):
238 tmp.append((i, k))
239
240 x = X()
241 x[1:2] = 42
242 self.assertEqual(tmp, [(slice(1, 2), 42)])
243
244 def test_pickle(self):
245 import pickle

Callers

nothing calls this directly

Calls 3

sliceClass · 0.85
XClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected