]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings...
authorLandon Wood <landon@elkrange.com>
Wed, 22 May 2024 01:15:40 +0000 (21:15 -0400)
committerGitHub <noreply@github.com>
Wed, 22 May 2024 01:15:40 +0000 (01:15 +0000)
Doc/library/stdtypes.rst

index f97597dc56544991903eb571f36a47ceaed0305c..c0a3d0b3a2a49e5780860325479af92c5c7db1a4 100644 (file)
@@ -4565,7 +4565,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*.
 
@@ -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)
 
       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
@@ -4617,7 +4617,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