Skip to content

Commit 4279a79

Browse files
committed
Document add and setdefault
1 parent db2b778 commit 4279a79

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/multidict.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,18 @@ MutableMultiDict
167167

168168
Set ``d[key]`` to *value*.
169169

170+
Replace all items where key is equal to *key* with single item
171+
``(key, value)``.
172+
170173
.. method:: del d[key]
171174

172-
Remove ``d[key]`` from *d*.
175+
Remove all items where key is equal to *key* from *d*.
173176
Raises a :exc:`KeyError` if *key* is not in the map.
174177

178+
.. method:: add(key, value)
179+
180+
Append ``(key, value)`` pair to the dictiaonary.
181+
175182
.. method:: clear()
176183

177184
Remove all items from the dictionary.
@@ -187,3 +194,9 @@ MutableMultiDict
187194
length two). If keyword arguments are specified, the dictionary
188195
is then extended with those key/value pairs:
189196
``d.extend(red=1, blue=2)``.
197+
198+
.. method:: setdefault(key[, default])
199+
200+
If *key* is in the dictionary, return its the **first** value.
201+
If not, insert *key* with a value of *default* and return *default*.
202+
*default* defaults to ``None``.

0 commit comments

Comments
 (0)