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

Method __getitem__

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

Source from the content-addressed store, hash-verified

3986 self.assertEqual(str.__getitem__("hello", slice(4)), "hell")
3987 class S(str):
3988 def __getitem__(self, x):
3989 return str.__getitem__(self, x)
3990 self.assertEqual(S("hello")[:4], "hell")
3991 self.assertEqual(S("hello")[slice(4)], "hell")
3992 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