MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / pop

Method pop

bson/son.py:142–152  ·  view source on GitHub ↗
(self, key: _Key, *args: Union[_Value, _T])

Source from the content-addressed store, hash-verified

140 return default
141
142 def pop(self, key: _Key, *args: Union[_Value, _T]) -> Union[_Value, _T]:
143 if len(args) > 1:
144 raise TypeError("pop expected at most 2 arguments, got " + repr(1 + len(args)))
145 try:
146 value = self[key]
147 except KeyError:
148 if args:
149 return args[0]
150 raise
151 del self[key]
152 return value
153
154 def popitem(self) -> Tuple[_Key, _Value]:
155 try:

Callers 15

simplifyFunction · 0.95
simplifyFunction · 0.95
__init__Method · 0.45
__init__Method · 0.45
run_scenarioFunction · 0.45
sanitize_cmdFunction · 0.45
sanitize_replyFunction · 0.45
disableMethod · 0.45

Calls

no outgoing calls

Tested by 15

run_scenarioFunction · 0.36
check_errorMethod · 0.36
run_scenarioMethod · 0.36
create_clientMethod · 0.36
create_clientMethod · 0.36
assertEqualWriteErrorMethod · 0.36