]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 30 Mar 2025 09:28:49 +0000 (11:28 +0200)
committerGitHub <noreply@github.com>
Sun, 30 Mar 2025 09:28:49 +0000 (09:28 +0000)
gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (GH-128208)
(cherry picked from commit edfbd8c062285e83dc5f596288df2a762e68bcdc)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
Doc/library/stdtypes.rst

index 2f4cd43cae4ad9075757fb9f3f6b69096b9f506a..942e89b6235c6bf76dacafc089fc08985cc91e69 100644 (file)
@@ -4586,7 +4586,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=None)
+   .. 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
@@ -4628,7 +4628,7 @@ can be used interchangeably to index the same dictionary entry.
 
       .. versionadded:: 3.8
 
-   .. method:: setdefault(key, default=None)
+   .. 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