Skip to content

Commit 05cb383

Browse files
committed
a bit of copy editing.
1 parent c689032 commit 05cb383

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/modules/Comprehensions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Comprehensions and map()
8888

8989
Comprehensions are another way of expressing the "map" pattern from functional programming.
9090

91-
Python does have a ``map()`` function, which pre-dates comprehensions. But it does much of the same things -- and most folks think comprehensions are the more "Pythonic" way to do it. And there is nothing that can be expressed with ``map()`` that cannot be done with a comprehension. IF youare not familiar with ``map()``, you can saftly skip this, but if you are:
91+
Python does have a ``map()`` function, which pre-dates comprehensions. But it does much of the same things -- and most folks think comprehensions are the more "Pythonic" way to do it. And there is nothing that can be expressed with ``map()`` that cannot be done with a comprehension. If you are not familiar with ``map()``, you can safely skip this, but if you are:
9292

9393
.. code-block:: python
9494
@@ -100,7 +100,7 @@ is the same as:
100100
101101
[a_function(item), for item in an_iterable]
102102
103-
In this case, the comprehension is a tad wordier than ``map()``. BUt comprehensions really shine when you do'nt already have a handy function to pass to map:
103+
In this case, the comprehension is a tad wordier than ``map()``. But comprehensions really shine when you don't already have a handy function to pass to map:
104104

105105
.. code-block:: python
106106
@@ -144,7 +144,7 @@ This kind of "filtering" loop can be achieved by adding a conditional to the com
144144
145145
new_list = [expr for var in a_list if something_is_true]
146146
147-
This is expressing the "filter" pattern and the "map" pattern at the same time -- one reason I like the comprehension sytax so much.
147+
This is expressing the "filter" pattern and the "map" pattern at the same time -- one reason I like the comprehension syntax so much.
148148

149149

150150
.. rubric:: Examples:
@@ -477,4 +477,4 @@ Once you've got the hang of it, you may want to read this so you don't overdo it
477477
478478
https://treyhunner.com/2019/03/abusing-and-overusing-list-comprehensions-in-python/
479479
480-
Trey writes a lot of good stuff -- I recommned browsing his site.
480+
Trey writes a lot of good stuff -- I recommend browsing his site.

0 commit comments

Comments
 (0)