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

Method discard

Lib/mailbox.py:338–344  ·  view source on GitHub ↗

If the keyed message exists, remove it.

(self, key)

Source from the content-addressed store, hash-verified

336 os.remove(os.path.join(self._path, self._lookup(key)))
337
338 def discard(self, key):
339 """If the keyed message exists, remove it."""
340 # This overrides an inapplicable implementation in the superclass.
341 try:
342 self.remove(key)
343 except (KeyError, FileNotFoundError):
344 pass
345
346 def __setitem__(self, key, message):
347 """Replace the keyed message; raise KeyError if it doesn't exist."""

Callers 1

__setitem__Method · 0.95

Calls 1

removeMethod · 0.95

Tested by

no test coverage detected