MCPcopy
hub / github.com/pallets/werkzeug / add

Method add

src/werkzeug/datastructures/structures.py:248–256  ·  view source on GitHub ↗

Adds a new value for the key. .. versionadded:: 0.6 :param key: the key for the value. :param value: the value to add.

(self, key: K, value: V)

Source from the content-addressed store, hash-verified

246 super().__setitem__(key, [value]) # type: ignore[assignment]
247
248 def add(self, key: K, value: V) -> None:
249 """Adds a new value for the key.
250
251 .. versionadded:: 0.6
252
253 :param key: the key for the value.
254 :param value: the value to add.
255 """
256 super().setdefault(key, []).append(value) # type: ignore[arg-type,attr-defined]
257
258 @t.overload
259 def getlist(self, key: K) -> list[V]: ...

Callers 7

updateMethod · 0.95
itemsMethod · 0.45
listsMethod · 0.45
itemsMethod · 0.45
__init__Method · 0.45
updateMethod · 0.45
__setitem__Method · 0.45

Calls 2

appendMethod · 0.80
setdefaultMethod · 0.45

Tested by

no test coverage detected