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

Method __getitem__

Lib/mailbox.py:71–77  ·  view source on GitHub ↗

Return the keyed message; raise KeyError if it doesn't exist.

(self, key)

Source from the content-addressed store, hash-verified

69 return default
70
71 def __getitem__(self, key):
72 """Return the keyed message; raise KeyError if it doesn't exist."""
73 if not self._factory:
74 return self.get_message(key)
75 else:
76 with contextlib.closing(self.get_file(key)) as file:
77 return self._factory(file)
78
79 def get_message(self, key):
80 """Return a Message representation or raise a KeyError."""

Callers 2

getMethod · 0.95
test_notimplementedMethod · 0.95

Calls 4

get_messageMethod · 0.95
get_fileMethod · 0.95
closingMethod · 0.80
_factoryMethod · 0.80

Tested by 1

test_notimplementedMethod · 0.76