Skip to content

Commit aa76da2

Browse files
committed
Fixed minor typos in writing/style
1 parent 358b2f6 commit aa76da2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/writing/style.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ while privatising a public property might be a much harder operation.
217217
Returning 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
221221
inside the function's body. However, in order to keep a clear intent and a sustainable
222222
readability level, it is preferable to avoid returning meaningful values from many
223223
output 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
226226
return when it has been processed normally, and the error cases that indicate a wrong
227227
input parameter or any other reason for the function to not be able to complete its
228228
computation or task.
@@ -261,7 +261,7 @@ is discussed amply at `c2 <http://c2.com/cgi/wiki?ProgrammingIdiom>`_ and at `St
261261

262262
Idiomatic 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,
266266
good 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,
508508
more 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

Comments
 (0)