changeset: 79211:6c96878eb729 branch: 3.2 parent: 79203:0362d64c783a user: Chris Jerdonek date: Fri Sep 28 07:07:12 2012 -0700 files: Doc/tutorial/datastructures.rst description: Close issue #16073: fix map() example in list comprehension documentation. Thanks for the e-mail report to docs@. diff -r 0362d64c783a -r 6c96878eb729 Doc/tutorial/datastructures.rst --- a/Doc/tutorial/datastructures.rst Fri Sep 28 14:14:03 2012 +0100 +++ b/Doc/tutorial/datastructures.rst Fri Sep 28 07:07:12 2012 -0700 @@ -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

AltStyle によって変換されたページ (->オリジナル) /