summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-01-27 14:14:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-01-27 14:14:01 (GMT)
commit871b9d169d839706492d861a20ce5d1018beebd9 (patch)
treef13cd0ae08e46d6aef8712b46d0d3d768ed7dbec
parent04707c032efc21a7e57d6c9a46fdda5e43171966 (diff)
downloadcpython-871b9d169d839706492d861a20ce5d1018beebd9.zip
cpython-871b9d169d839706492d861a20ce5d1018beebd9.tar.gz
cpython-871b9d169d839706492d861a20ce5d1018beebd9.tar.bz2
note that get() is not affected by default_factory (closes #13887)
-rw-r--r--Doc/library/collections.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index e512bf1..e90b25e 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -468,6 +468,11 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
:class:`dict` class when the requested key is not found; whatever it
returns or raises is then returned or raised by :meth:`__getitem__`.
+ Note that :meth:`__missing__` is *not* called for any operations besides
+ :meth:`__getitem__`. This means that :meth:`get` will, like normal
+ dictionaries, return ``None`` as a default rather than using
+ :attr:`default_factory`.
+
:class:`defaultdict` objects support the following instance variable: