mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue 21533: Dicts take iterables, not iterators. Patch by Wolfgang Maier.
This commit is contained in:
parent
8d21357fb5
commit
b52f876767
2 changed files with 3 additions and 2 deletions
|
@ -3031,8 +3031,8 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
|
||||||
If no positional argument is given, an empty dictionary is created.
|
If no positional argument is given, an empty dictionary is created.
|
||||||
If a positional argument is given and it is a mapping object, a dictionary
|
If a positional argument is given and it is a mapping object, a dictionary
|
||||||
is created with the same key-value pairs as the mapping object. Otherwise,
|
is created with the same key-value pairs as the mapping object. Otherwise,
|
||||||
the positional argument must be an :term:`iterator` object. Each item in
|
the positional argument must be an :term:`iterable` object. Each item in
|
||||||
the iterable must itself be an iterator with exactly two objects. The
|
the iterable must itself be an iterable with exactly two objects. The
|
||||||
first object of each item becomes a key in the new dictionary, and the
|
first object of each item becomes a key in the new dictionary, and the
|
||||||
second object the corresponding value. If a key occurs more than once, the
|
second object the corresponding value. If a key occurs more than once, the
|
||||||
last value for that key becomes the corresponding value in the new
|
last value for that key becomes the corresponding value in the new
|
||||||
|
|
|
@ -818,6 +818,7 @@ Tim MacKenzie
|
||||||
Nick Maclaren
|
Nick Maclaren
|
||||||
Don MacMillen
|
Don MacMillen
|
||||||
Tomasz Maćkowiak
|
Tomasz Maćkowiak
|
||||||
|
Wolfgang Maier
|
||||||
Steve Majewski
|
Steve Majewski
|
||||||
Marek Majkowski
|
Marek Majkowski
|
||||||
Grzegorz Makarewicz
|
Grzegorz Makarewicz
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue