]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] 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:29:49 +0000 (11:29 +0200)
committerGitHub <noreply@github.com>
Sun, 30 Mar 2025 09:29:49 +0000 (09:29 +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 c0b6b9ed6c0023ba3d6cf89a125fe3da7882d755..31b0f6f12544bc228bb5d855ebcb5867be507731 100644 (file)
@@ -4577,7 +4577,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
@@ -4619,7 +4619,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