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

Method _lookup

Lib/mailbox.py:795–803  ·  view source on GitHub ↗

Return (start, stop) or raise KeyError.

(self, key=None)

Source from the content-addressed store, hash-verified

793 self._file.close() # Sync has been done by self.flush() above.
794
795 def _lookup(self, key=None):
796 """Return (start, stop) or raise KeyError."""
797 if self._toc is None:
798 self._generate_toc()
799 if key is not None:
800 try:
801 return self._toc[key]
802 except KeyError:
803 raise KeyError('No message with key: %s' % key) from None
804
805 def _append_message(self, message):
806 """Append message to mailbox and return (start, stop) offsets."""

Callers 6

addMethod · 0.95
removeMethod · 0.95
__setitem__Method · 0.95
iterkeysMethod · 0.95
__contains__Method · 0.95
__len__Method · 0.95

Calls 1

_generate_tocMethod · 0.45

Tested by

no test coverage detected