diff options
Diffstat (limited to 'netlib/multidict.py')
-rw-r--r-- | netlib/multidict.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/netlib/multidict.py b/netlib/multidict.py index 98fde7e3..f8876cbd 100644 --- a/netlib/multidict.py +++ b/netlib/multidict.py @@ -171,6 +171,14 @@ class _MultiDict(MutableMapping, Serializable): else: return super(_MultiDict, self).items() + def clear(self, key): + """ + Removes all items with the specified key, and does not raise an + exception if the key does not exist. + """ + if key in self: + del self[key] + def to_dict(self): """ Get the MultiDict as a plain Python dict. |