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)
| 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.""" |