Skip to content

Commit

Permalink
[3.12] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() do…
Browse files Browse the repository at this point in the history
…cs with docstrings (GH-119330) (#119371)

(cherry picked from commit 0e3c8cd)

Co-authored-by: Landon Wood <landon@elkrange.com>
  • Loading branch information
miss-islington and johnlandonwood committed May 22, 2024
1 parent 47b09d2 commit 9801fba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4556,7 +4556,7 @@ can be used interchangeably to index the same dictionary entry.

Return a shallow copy of the dictionary.

.. classmethod:: fromkeys(iterable[, value])
.. classmethod:: fromkeys(iterable, value=None)

Create a new dictionary with keys from *iterable* and values set to *value*.

Expand All @@ -4566,7 +4566,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)

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 Expand Up @@ -4608,7 +4608,7 @@ can be used interchangeably to index the same dictionary entry.

.. versionadded:: 3.8

.. method:: setdefault(key[, default])
.. method:: setdefault(key, default=None)

If *key* is in the dictionary, return its value. If not, insert *key*
with a value of *default* and return *default*. *default* defaults to
Expand Down

0 comments on commit 9801fba

Please sign in to comment.