From: Adam Dangoor Date: Sun, 30 Mar 2025 09:22:57 +0000 (+0100) Subject: gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments... X-Git-Tag: v3.14.0a7~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edfbd8c062285e83dc5f596288df2a762e68bcdc;p=thirdparty%2FPython%2Fcpython.git gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (#128208) --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 50bad396933a..48d179c27037 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4780,7 +4780,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 ` 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 @@ -4822,7 +4822,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