MCPcopy Index your code
hub / github.com/python/cpython / pop

Method pop

Lib/_collections_abc.py:720–728  ·  view source on GitHub ↗

Return the popped value. Raise KeyError if empty.

(self)

Source from the content-addressed store, hash-verified

718 self.discard(value)
719
720 def pop(self):
721 """Return the popped value. Raise KeyError if empty."""
722 it = iter(self)
723 try:
724 value = next(it)
725 except StopIteration:
726 raise KeyError from None
727 self.discard(value)
728 return value
729
730 def clear(self):
731 """This is slow (creates N new iterators!) but effective."""

Callers 2

clearMethod · 0.95

Calls 1

discardMethod · 0.95

Tested by

no test coverage detected