Skip to content

Commit 000b076

Browse files
adamtheturtlemiss-islington
authored andcommitted
pythongh-131885: Document that dict.setdefault and dict.get take no keyword arguments (pythonGH-128208)
(cherry picked from commit edfbd8c) Co-authored-by: Adam Dangoor <[email protected]>
1 parent f1b65d7 commit 000b076

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/stdtypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4577,7 +4577,7 @@ can be used interchangeably to index the same dictionary entry.
45774577
such as an empty list. To get distinct values, use a :ref:`dict
45784578
comprehension <dict>` instead.
45794579

4580-
.. method:: get(key, default=None)
4580+
.. method:: get(key, default=None, /)
45814581

45824582
Return the value for *key* if *key* is in the dictionary, else *default*.
45834583
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.
46194619

46204620
.. versionadded:: 3.8
46214621

4622-
.. method:: setdefault(key, default=None)
4622+
.. method:: setdefault(key, default=None, /)
46234623

46244624
If *key* is in the dictionary, return its value. If not, insert *key*
46254625
with a value of *default* and return *default*. *default* defaults to

0 commit comments

Comments
 (0)