[Python-checkins] cpython (2.7): #16206: Improve examples about dict construction.

ezio.melotti python-checkins at python.org
Fri Oct 26 18:16:07 CEST 2012


http://hg.python.org/cpython/rev/361beec678e1
changeset:   79940:361beec678e1
branch:      2.7
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Fri Oct 26 19:14:16 2012 +0300
summary:
  #16206: Improve examples about dict construction.

files:
  Doc/library/stdtypes.rst |  14 +++++++-------
  1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1979,13 +1979,13 @@
    replaces the value from the positional argument.
 
    To illustrate, the following examples all return a dictionary equal to
-   ``{"one": 1, "two": 2}``::
-
-      >>> 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}
+   ``{"one": 1, "two": 2, "three": 3}``::
+
+      >>> 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
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list