@@ -217,12 +217,12 @@ while privatising a public property might be a much harder operation.
217217Returning values
218218~~~~~~~~~~~~~~~~
219219
220- When a function grows in complexity is not uncommon to use multiple return statements
220+ When a function grows in complexity it is not uncommon to use multiple return statements
221221inside the function's body. However, in order to keep a clear intent and a sustainable
222222readability level, it is preferable to avoid returning meaningful values from many
223223output points in the body.
224224
225- There are two main cases for returning values in a function: The result of the function
225+ There are two main cases for returning values in a function: the result of the function
226226return when it has been processed normally, and the error cases that indicate a wrong
227227input parameter or any other reason for the function to not be able to complete its
228228computation or task.
@@ -261,7 +261,7 @@ is discussed amply at `c2 <http://c2.com/cgi/wiki?ProgrammingIdiom>`_ and at `St
261261
262262Idiomatic Python code is often referred to as being *Pythonic *.
263263
264- Although there usually is one-- and preferably only one --obvious way to do it;
264+ Although there usually is one --- and preferably only one --- obvious way to do it;
265265*the * way to write idiomatic Python code can be non-obvious to Python beginners. So,
266266good idioms must be consciously acquired.
267267
@@ -503,7 +503,7 @@ Short Ways to Manipulate Lists
503503
504504`List comprehensions
505505<http://docs.python.org/tutorial/datastructures.html#list-comprehensions> `_
506- provide a powerful, concise way to work with lists. Also, the :py:func: `map `
506+ provide a powerful, concise way to work with lists. Also, the :py:func: `map ` and
507507:py:func: `filter ` functions can perform operations on lists using a different,
508508more concise syntax.
509509
@@ -524,6 +524,7 @@ more concise syntax.
524524
525525 a = [3 , 4 , 5 ]
526526 b = [i for i in a if i > 4 ]
527+ # Or:
527528 b = filter (lambda x : x > 4 , a)
528529
529530 **Bad **:
0 commit comments