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

Method poplist

src/werkzeug/datastructures/structures.py:522–530  ·  view source on GitHub ↗

Pop the list for a key from the dict. If the key is not in the dict an empty list is returned. .. versionchanged:: 0.5 If the key does no longer exist a list is returned instead of raising an error.

(self, key: K)

Source from the content-addressed store, hash-verified

520 raise exceptions.BadRequestKeyError(e.args[0]) from None
521
522 def poplist(self, key: K) -> list[V]:
523 """Pop the list for a key from the dict. If the key is not in the dict
524 an empty list is returned.
525
526 .. versionchanged:: 0.5
527 If the key does no longer exist a list is returned instead of
528 raising an error.
529 """
530 return super().pop(key, []) # type: ignore[return-value]
531
532 def popitemlist(self) -> tuple[K, list[V]]:
533 """Pop a ``(key, list)`` tuple from the dict."""

Callers 2

test_basic_interfaceMethod · 0.45

Calls 1

popMethod · 0.45

Tested by 2

test_basic_interfaceMethod · 0.36