]> granicus.if.org Git - python/commitdiff
note that get() is not affected by default_factory (closes #13887)
authorBenjamin Peterson <benjamin@python.org>
Fri, 27 Jan 2012 14:14:01 +0000 (09:14 -0500)
committerBenjamin Peterson <benjamin@python.org>
Fri, 27 Jan 2012 14:14:01 +0000 (09:14 -0500)
Doc/library/collections.rst

index b315a73990e7558765fd811e611059a7c36c168c..abb36dbbc2ef4a9d213b3bbc533a85fe47887cd5 100644 (file)
@@ -469,6 +469,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: