Skip to content

Commit

Permalink
Merge pull request RunestoneInteractive#88 from wysockin/advaccum-map…
Browse files Browse the repository at this point in the history
…ping-typo

Typo After First example
  • Loading branch information
presnick committed Dec 23, 2014
2 parents d657a10 + 258f05a commit 7cfd52b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pip2/source/AdvancedAccumulation/map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following function produces a new list with each item in the original list d
things = doubleStuff(things)
print things

The doubleStuff function is an example of the accumulator pattern, in particular the mapping pattern. On line 3, new_list is initialized. On line 5, the doubled value for the current item is produced and on line 6 it is appended to the list we're accumulating. Line 7 executes after we've processrf all the items in the original list: it returns the new_list. Once again, codelens helps us to see the actual references and objects as they are passed and returned.
The doubleStuff function is an example of the accumulator pattern, in particular the mapping pattern. On line 3, new_list is initialized. On line 5, the doubled value for the current item is produced and on line 6 it is appended to the list we're accumulating. Line 7 executes after we've processed all the items in the original list: it returns the new_list. Once again, codelens helps us to see the actual references and objects as they are passed and returned.

.. codelens:: listcomp_2

Expand Down

0 comments on commit 7cfd52b

Please sign in to comment.