MCPcopy Index your code
hub / github.com/RustPython/RustPython / __getitem__

Method __getitem__

Lib/test/test_descr.py:3921–3922  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

3919 self.assertEqual(list.__getitem__([1,2,3], slice(2)), [1,2])
3920 class L(list):
3921 def __getitem__(self, x):
3922 return list.__getitem__(self, x)
3923 self.assertEqual(L([1,2,3])[:2], [1,2])
3924 self.assertEqual(L([1,2,3])[slice(2)], [1,2])
3925 self.assertEqual(L([1,2,3]).__getitem__(slice(2)), [1,2])

Callers

nothing calls this directly

Calls 1

__getitem__Method · 0.45

Tested by

no test coverage detected