Skip to content

Commit 0e3c8cd

Browse files
gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings (#119330)
1 parent 98e855f commit 0e3c8cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/stdtypes.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -4565,7 +4565,7 @@ can be used interchangeably to index the same dictionary entry.
45654565

45664566
Return a shallow copy of the dictionary.
45674567

4568-
.. classmethod:: fromkeys(iterable[, value])
4568+
.. classmethod:: fromkeys(iterable, value=None)
45694569

45704570
Create a new dictionary with keys from *iterable* and values set to *value*.
45714571

@@ -4575,7 +4575,7 @@ can be used interchangeably to index the same dictionary entry.
45754575
such as an empty list. To get distinct values, use a :ref:`dict
45764576
comprehension <dict>` instead.
45774577

4578-
.. method:: get(key[, default])
4578+
.. method:: get(key, default=None)
45794579

45804580
Return the value for *key* if *key* is in the dictionary, else *default*.
45814581
If *default* is not given, it defaults to ``None``, so that this method
@@ -4617,7 +4617,7 @@ can be used interchangeably to index the same dictionary entry.
46174617

46184618
.. versionadded:: 3.8
46194619

4620-
.. method:: setdefault(key[, default])
4620+
.. method:: setdefault(key, default=None)
46214621

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

0 commit comments

Comments
 (0)