mirror of
https://github.com/python/cpython.git
synced 2025-10-02 05:12:23 +00:00
Document that dict.fromkeys accepts any iterable for keys (GH-10998)
This commit is contained in:
parent
3ce3dea606
commit
f06fba5965
1 changed files with 2 additions and 2 deletions
|
@ -4239,9 +4239,9 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
|
|||
|
||||
Return a shallow copy of the dictionary.
|
||||
|
||||
.. classmethod:: fromkeys(seq[, value])
|
||||
.. classmethod:: fromkeys(iterable[, value])
|
||||
|
||||
Create a new dictionary with keys from *seq* and values set to *value*.
|
||||
Create a new dictionary with keys from *iterable* and values set to *value*.
|
||||
|
||||
:meth:`fromkeys` is a class method that returns a new dictionary. *value*
|
||||
defaults to ``None``.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue