mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Make twisted example a bit more logical.
This commit is contained in:
parent
c8148265dc
commit
c16e8f17ac
1 changed files with 5 additions and 5 deletions
|
@ -2046,12 +2046,12 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
|
||||||
values are added as items to the dictionary. If a key is specified both in
|
values are added as items to the dictionary. If a key is specified both in
|
||||||
the positional argument and as a keyword argument, the value associated with
|
the positional argument and as a keyword argument, the value associated with
|
||||||
the keyword is retained in the dictionary. For example, these all return a
|
the keyword is retained in the dictionary. For example, these all return a
|
||||||
dictionary equal to ``{"one": 2, "two": 3}``:
|
dictionary equal to ``{"one": 1, "two": 2}``:
|
||||||
|
|
||||||
* ``dict(one=2, two=3)``
|
* ``dict(one=1, two=2)``
|
||||||
* ``dict({'one': 2, 'two': 3})``
|
* ``dict({'one': 1, 'two': 2})``
|
||||||
* ``dict(zip(('one', 'two'), (2, 3)))``
|
* ``dict(zip(('one', 'two'), (1, 2)))``
|
||||||
* ``dict([['two', 3], ['one', 2]])``
|
* ``dict([['two', 2], ['one', 1]])``
|
||||||
|
|
||||||
The first example only works for keys that are valid Python identifiers; the
|
The first example only works for keys that are valid Python identifiers; the
|
||||||
others work with any valid keys.
|
others work with any valid keys.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue