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

Method __getitem__

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

Source from the content-addressed store, hash-verified

3899 self.assertEqual(str.__getitem__("hello", slice(4)), "hell")
3900 class S(str):
3901 def __getitem__(self, x):
3902 return str.__getitem__(self, x)
3903 self.assertEqual(S("hello")[:4], "hell")
3904 self.assertEqual(S("hello")[slice(4)], "hell")
3905 self.assertEqual(S("hello").__getitem__(slice(4)), "hell")

Callers

nothing calls this directly

Calls 1

__getitem__Method · 0.45

Tested by

no test coverage detected