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

Method popitem

Lib/collections/__init__.py:1130–1135  ·  view source on GitHub ↗

Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.

(self)

Source from the content-addressed store, hash-verified

1128 raise KeyError(f'Key not found in the first mapping: {key!r}')
1129
1130 def popitem(self):
1131 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
1132 try:
1133 return self.maps[0].popitem()
1134 except KeyError:
1135 raise KeyError('No keys found in the first mapping.')
1136
1137 def pop(self, key, *args):
1138 'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].'

Callers 15

check_popitemMethod · 0.45
test_popitemMethod · 0.45
test_allMethod · 0.45
test_popitemMethod · 0.45
mutateMethod · 0.45
test_missingMethod · 0.45
test_basicsMethod · 0.45
__init__Method · 0.45
test_writeMethod · 0.45

Calls

no outgoing calls

Tested by 15

check_popitemMethod · 0.36
test_popitemMethod · 0.36
test_allMethod · 0.36
test_popitemMethod · 0.36
mutateMethod · 0.36
test_missingMethod · 0.36
test_basicsMethod · 0.36
__init__Method · 0.36
test_writeMethod · 0.36