Visitar URL original
gh-110383: Update dict `get`, `fromkeys`, and `setdefault` signatures in docs by johnlandonwood · Pull Request #119330 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update default to default=None in dict .get() doc
  • Loading branch information
johnlandonwood committed May 21, 2024
commit d6ed6e8758db843afeb122d09ea89fa353ccd2bf
2 changes: 1 addition & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4575,7 +4575,7 @@ can be used interchangeably to index the same dictionary entry.
such as an empty list. To get distinct values, use a :ref:`dict
comprehension <dict>` instead.

.. method:: get(key[, default])
.. method:: get(key[, default=None])
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated

Return the value for *key* if *key* is in the dictionary, else *default*.
If *default* is not given, it defaults to ``None``, so that this method
Expand Down