MCPcopy Create free account
hub / github.com/bpython/bpython / __getitem__

Method __getitem__

bpython/keys.py:34–43  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

32 self.default = default
33
34 def __getitem__(self, key: str) -> T:
35 if not key:
36 # Unbound key
37 return self.default
38 elif key in self.map:
39 return self.map[key]
40 else:
41 raise KeyError(
42 f"Configured keymap ({key}) does not exist in bpython.keys"
43 )
44
45 def __delitem__(self, key: str) -> None:
46 del self.map[key]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected