mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
gh-131885: Document that dict.setdefault
and dict.get
take no keyword arguments (#128208)
This commit is contained in:
parent
044a1e13d5
commit
edfbd8c062
1 changed files with 2 additions and 2 deletions
|
@ -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
|
such as an empty list. To get distinct values, use a :ref:`dict
|
||||||
comprehension <dict>` instead.
|
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*.
|
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
|
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
|
.. 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*
|
If *key* is in the dictionary, return its value. If not, insert *key*
|
||||||
with a value of *default* and return *default*. *default* defaults to
|
with a value of *default* and return *default*. *default* defaults to
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue