diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-10-26 16:14:16 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-10-26 16:14:16 (GMT) |
commit | a20879ffc8dfebab5b6949bed9b13453c8a6cde3 (patch) | |
tree | 8884bcfe514dd381b365b307e23e5da01dea849c /Doc/library | |
parent | c131b0760d9d9c478e3dad0240040d75793c652d (diff) | |
download | cpython-a20879ffc8dfebab5b6949bed9b13453c8a6cde3.zip cpython-a20879ffc8dfebab5b6949bed9b13453c8a6cde3.tar.gz cpython-a20879ffc8dfebab5b6949bed9b13453c8a6cde3.tar.bz2 |
#16206: Improve examples about dict construction.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/stdtypes.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 20174c5..78a2799 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2137,13 +2137,13 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: replaces the value from the positional argument. To illustrate, the following examples all return a dictionary equal to - ``{"one": 1, "two": 2}``:: + ``{"one": 1, "two": 2, "three": 3}``:: - >>> a = dict(one=1, two=2) - >>> b = dict({'one': 1, 'two': 2}) - >>> c = dict(zip(('one', 'two'), (1, 2))) - >>> d = dict([['two', 2], ['one', 1]]) - >>> e = {"one": 1, "two": 2} + >>> a = dict(one=1, two=2, three=3) + >>> b = {'one': 1, 'two': 2, 'three': 3} + >>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3])) + >>> d = dict([('two', 2), ('one', 1), ('three', 3)]) + >>> e = dict({'three': 3, 'one': 1, 'two': 2}) >>> a == b == c == d == e True |