[Python-checkins] cpython (3.2): Close issue #16073: fix map() example in list comprehension documentation.

chris.jerdonek python-checkins at python.org
Fri Sep 28 16:26:10 CEST 2012


http://hg.python.org/cpython/rev/6c96878eb729
changeset:   79211:6c96878eb729
branch:      3.2
parent:      79203:0362d64c783a
user:        Chris Jerdonek <chris.jerdonek at gmail.com>
date:        Fri Sep 28 07:07:12 2012 -0700
summary:
  Close issue #16073: fix map() example in list comprehension documentation.

Thanks for the e-mail report to docs at .

files:
  Doc/tutorial/datastructures.rst |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -181,7 +181,7 @@
 
    squares = [x**2 for x in range(10)]
 
-This is also equivalent to ``squares = map(lambda x: x**2, range(10))``,
+This is also equivalent to ``squares = list(map(lambda x: x**2, range(10)))``,
 but it's more concise and readable.
 
 A list comprehension consists of brackets containing an expression followed

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


More information about the Python-checkins mailing list