From: Benjamin Peterson Date: Fri, 27 Jan 2012 14:14:01 +0000 (-0500) Subject: note that get() is not affected by default_factory (closes #13887) X-Git-Tag: v2.7.3rc1~119 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78028b0589597365f354c0b183a1cf9d294e0237;p=python note that get() is not affected by default_factory (closes #13887) --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index b315a73990..abb36dbbc2 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -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: