Skip to content

Commit edfbd8c

Browse files
pythongh-131885: Document that dict.setdefault and dict.get take no keyword arguments (python#128208)
1 parent 044a1e1 commit edfbd8c

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
@@ -4780,7 +4780,7 @@ can be used interchangeably to index the same dictionary entry.
47804780
such as an empty list. To get distinct values, use a :ref:`dict
47814781
comprehension <dict>` instead.
47824782

4783-
.. method:: get(key, default=None)
4783+
.. method:: get(key, default=None, /)
47844784

47854785
Return the value for *key* if *key* is in the dictionary, else *default*.
47864786
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.
48224822

48234823
.. versionadded:: 3.8
48244824

4825-
.. method:: setdefault(key, default=None)
4825+
.. method:: setdefault(key, default=None, /)
48264826

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy