]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrin...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 22 May 2024 01:22:05 +0000 (03:22 +0200)
committerGitHub <noreply@github.com>
Wed, 22 May 2024 01:22:05 +0000 (01:22 +0000)
(cherry picked from commit 0e3c8cda1f04c983994e76aea93600dbb4714832)

Co-authored-by: Landon Wood <landon@elkrange.com>
Doc/library/stdtypes.rst

index f5d5e1d54a72cd4ef3179b60ba30a1566e9c2c1d..d11bfb803f8c56381549294c6240e6198929bd14 100644 (file)
@@ -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*.
 
@@ -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
@@ -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