mirror of
https://github.com/python/cpython
synced 2026-09-29 11:55:30 +03:00
note that get() is not affected by default_factory (closes #13887)
This commit is contained in:
parent
04707c032e
commit
871b9d169d
1 changed files with 5 additions and 0 deletions
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue