MCPcopy
hub / github.com/encode/starlette / setdefault

Method setdefault

starlette/datastructures.py:348–353  ·  starlette/datastructures.py::MultiDict.setdefault
(self, key: Any, default: Any = None)

Source from the content-addressed store, hash-verified

346 self._list.clear()
347
348 def setdefault(self, key: Any, default: Any = None) -> Any:
349 if key not in self:
350 self._dict[key] = default
351 self._list.append((key, default))
352
353 return self[key]
354
355 def setlist(self, key: Any, values: list[Any]) -> None:
356 if not values:

Callers 9

test_multidictFunction · 0.95
__init__Method · 0.45
websocket_connectMethod · 0.45
get_schemaMethod · 0.45
__init__Method · 0.45
set_stat_headersMethod · 0.45
stateMethod · 0.45
_setup_env_defaultsMethod · 0.45
TemplateResponseMethod · 0.45

Calls 1

appendMethod · 0.45

Tested by 3

test_multidictFunction · 0.76
__init__Method · 0.36
websocket_connectMethod · 0.36