MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / popitem

Method popitem

python/bplustree/__init__.py:66–75  ·  view source on GitHub ↗

Remove and return an arbitrary (key, value) pair.

(self)

Source from the content-addressed store, hash-verified

64 raise
65
66 def popitem(self):
67 """Remove and return an arbitrary (key, value) pair."""
68 try:
69 # Get the first key-value pair
70 for key, value in self.items():
71 del self[key]
72 return (key, value)
73 except:
74 pass
75 raise KeyError("popitem(): tree is empty")
76
77 def setdefault(self, key, default=None):
78 """Get value for key, setting and returning default if not present."""

Callers 5

demo_api_compatibilityFunction · 0.95
mainFunction · 0.95

Calls 1

itemsMethod · 0.95

Tested by 3