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

Method setdefault

bson/son.py:135–140  ·  view source on GitHub ↗
(self, key: _Key, default: _Value)

Source from the content-addressed store, hash-verified

133 super().clear()
134
135 def setdefault(self, key: _Key, default: _Value) -> _Value:
136 try:
137 return self[key]
138 except KeyError:
139 self[key] = default
140 return default
141
142 def pop(self, key: _Key, *args: Union[_Value, _T]) -> Union[_Value, _T]:
143 if len(args) > 1:

Callers 11

make_server_descriptionFunction · 0.45
helpers_shared.pyFile · 0.45
create_topologyFunction · 0.45
run_testFunction · 0.45
run_entity_operationMethod · 0.45
create_topologyFunction · 0.45
run_entity_operationMethod · 0.45

Calls

no outgoing calls

Tested by 4

make_server_descriptionFunction · 0.36
create_topologyFunction · 0.36
run_testFunction · 0.36
create_topologyFunction · 0.36