Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e3eac0c

Browse filesBrowse files
committed
Fix spelling in style.rst
1 parent 0ff2616 commit e3eac0c
Copy full SHA for e3eac0c

File tree

1 file changed

+14
-14
lines changed
Filter options

1 file changed

+14
-14
lines changed

‎docs/writing/style.rst

Copy file name to clipboardExpand all lines: docs/writing/style.rst
+14-14Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ most explicit and straightforward manner is preferred.
4141
def make_complex(x, y):
4242
return {'x': x, 'y': y}
4343
44-
In the good code above, x and y are explicitely received from
44+
In the good code above, x and y are explicitly received from
4545
the caller, and an explicit dictionary is returned. The developer
4646
using this function knows exactly what to do by reading the
4747
first and last lines, which is not the case with the bad example.
@@ -50,7 +50,7 @@ One statement per line
5050
~~~~~~~~~~~~~~~~~~~~~~
5151
5252
While some compound statements such as list comprehensions are
53-
allowed and appreciated for their brevity and their expressivity,
53+
allowed and appreciated for their brevity and their expressiveness,
5454
it is bad practice to have two disjoint statements on the same line.
5555
5656
**Bad**
@@ -107,10 +107,10 @@ passed another value.
107107
108108
Calling a function with keyword arguments can be done in multiple ways in Python,
109109
for example it is possible to follow the order of arguments in the definition without
110-
explicitely naming the arguments, like in ``send('Hello', 'World', 'Cthulhu`, 'God')``,
110+
explicitly naming the arguments, like in ``send('Hello', 'World', 'Cthulhu`, 'God')``,
111111
sending a blank carbon copy to God. It would also be possible to name arguments in
112112
another order, like in ``send('Hello again', 'World', bcc='God', cc='Cthulhu')``.
113-
Those two possibilities are better avoided whitout any strong reason to not
113+
Those two possibilities are better avoided without any strong reason to not
114114
follow the syntax that is the closest to the function definition: ``send('Hello',
115115
'World', cc='Cthulhu', bcc='God')``.
116116
@@ -132,13 +132,13 @@ However, this construct has some drawback and should be used with caution. If a
132132
function receives a list of arguments of the same nature, it is often more
133133
clear to define it as a function of one argument, that argument being a list or
134134
any sequence. Here, if ``send`` has multiple recipients, it is better to define
135-
it explicitely: ``send(message, recipients)`` and call it with ``send('Hello',
135+
it explicitly: ``send(message, recipients)`` and call it with ``send('Hello',
136136
['God', 'Mom', 'Cthulhu'])``. This way, the user of the function can manipulate
137-
the recipient list as a list beforhand, and it opens the possibility to pass
138-
any sequence, inculding iterators, that cannot be unpacked as other sequences.
137+
the recipient list as a list beforehand, and it opens the possibility to pass
138+
any sequence, including iterators, that cannot be unpacked as other sequences.
139139
140140
The **arbitrary keyword argument dictionary** is the last way to pass arguments
141-
to functions. If the function requires an undetermined serie of named
141+
to functions. If the function requires an undetermined series of named
142142
arguments, it is possible to used the ``**kwargs`` construct. In the function
143143
body, ``kwargs`` will be a dictionary of all the passed named arguments that
144144
have not been caught be other keyword argument in the function signature.
@@ -149,8 +149,8 @@ proven necessity to use them, and they should not be used if the simpler and
149149
clearer construct is sufficient to express the function's intention.
150150
151151
It is up to the programmer writing the function to determine which arguments
152-
are positional argmuents and which are optional keyword arguments, and to
153-
decide wheter to use the advanced techniques of arbitrary argument passing. If
152+
are positional arguments and which are optional keyword arguments, and to
153+
decide whether to use the advanced techniques of arbitrary argument passing. If
154154
the advices above are followed wisely, it is possible and enjoyable to write
155155
Python functions that are:
156156
@@ -164,7 +164,7 @@ Avoid the magical wand
164164
165165
A powerful tool for hackers, Python comes with a very rich set of hooks and
166166
tools allowing to do almost any kind of tricky tricks. For instance, it is
167-
possible to change how objects are created and instanciated, it is possible to
167+
possible to change how objects are created and instantiated, it is possible to
168168
change how the Python interpreter imports modules, it is even possible (and
169169
recommended if needed) to embed C routines in Python.
170170
@@ -222,7 +222,7 @@ output point in the body.
222222
223223
There are two main cases for returning values in a function: The result of the function
224224
return when it has been processed normally, and the error cases that indicate a wrong
225-
input paramter or any other reason for the function to not be able to complete its
225+
input parameter or any other reason for the function to not be able to complete its
226226
computation or task.
227227
228228
If you do not wish to raise exceptions for the second case, then returning a value, such
@@ -610,7 +610,7 @@ sometime but is preferably avoided, because of its fragility: a white space
610610
added to the end of the line, after the backslash, will break the code and may
611611
have unexpected results.
612612
613-
A prefered solution is to use parenthesis around your elements. Left with an
613+
A preferred solution is to use parenthesis around your elements. Left with an
614614
unclosed parenthesis on an end-of-line the Python interpreter will join the
615615
next line until the parenthesis is closed. The same behavior holds for curly
616616
and square braces.
@@ -624,7 +624,7 @@ and square braces.
624624
time to say “I’m going to sleep.”"""
625625
626626
from some.deep.module.inside.a.module import a_nice_function, another_nice_function, \
627-
yet_another_nice_functio
627+
yet_another_nice_function
628628
629629
**Good**:
630630

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.