diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-01-27 14:14:01 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-01-27 14:14:01 (GMT) |
commit | 78028b0589597365f354c0b183a1cf9d294e0237 (patch) | |
tree | 057d68455d7c487616527080b561d327fac28fac /Doc | |
parent | 374b4ea9da3dfa92641fff91015246a5ef6b27fb (diff) | |
download | cpython-78028b0589597365f354c0b183a1cf9d294e0237.zip cpython-78028b0589597365f354c0b183a1cf9d294e0237.tar.gz cpython-78028b0589597365f354c0b183a1cf9d294e0237.tar.bz2 |
note that get() is not affected by default_factory (closes #13887)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/collections.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index b315a73..abb36db 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: |