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

Method __getitem__

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

Source from the content-addressed store, hash-verified

3909 self.assertEqual(tuple.__getitem__((1,2,3), slice(2)), (1,2))
3910 class T(tuple):
3911 def __getitem__(self, x):
3912 return tuple.__getitem__(self, x)
3913 self.assertEqual(T((1,2,3))[:2], (1,2))
3914 self.assertEqual(T((1,2,3))[slice(2)], (1,2))
3915 self.assertEqual(T((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