MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / __getitem__

Method __getitem__

src/8/implementing_custom_containers/example2.py:8–10  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

6
7 # Required sequence methods
8 def __getitem__(self, index):
9 print('Getting:', index)
10 return self._items[index]
11
12 def __setitem__(self, index, value):
13 print('Setting:', index, value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected