MCPcopy Create free account
hub / github.com/cdgriffith/Box / popitem

Method popitem

box/box.py:781–788  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

779 self._box_config["__safe_keys"].clear()
780
781 def popitem(self):
782 if self._box_config["frozen_box"]:
783 raise BoxError("Box is frozen")
784 try:
785 key = next(self.__iter__())
786 except StopIteration:
787 raise BoxKeyError("Empty box") from None
788 return key, self.pop(key)
789
790 def __repr__(self) -> str:
791 return f"{self.__class__.__name__}({self})"

Callers 3

test_frozenMethod · 0.95
test_pop_itemsMethod · 0.95

Calls 4

__iter__Method · 0.95
popMethod · 0.95
BoxErrorClass · 0.90
BoxKeyErrorClass · 0.90

Tested by 3

test_frozenMethod · 0.76
test_pop_itemsMethod · 0.76