@@ -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
4545the caller, and an explicit dictionary is returned. The developer
4646using this function knows exactly what to do by reading the
4747first and last lines, which is not the case with the bad example.
@@ -50,7 +50,7 @@ One statement per line
5050~~~~~~~~~~~~~~~~~~~~~~
5151
5252While 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 ,
5454it is bad practice to have two disjoint statements on the same line.
5555
5656** Bad**
@@ -107,10 +107,10 @@ passed another value.
107107
108108Calling a function with keyword arguments can be done in multiple ways in Python,
109109for 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' )``,
111111sending a blank carbon copy to God. It would also be possible to name arguments in
112112another 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
114114follow 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
132132function receives a list of arguments of the same nature, it is often more
133133clear to define it as a function of one argument, that argument being a list or
134134any 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
140140The ** 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
142142arguments, it is possible to used the `` ** kwargs`` construct. In the function
143143body, `` kwargs`` will be a dictionary of all the passed named arguments that
144144have 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
149149clearer construct is sufficient to express the function' s intention.
150150
151151It 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
154154the advices above are followed wisely, it is possible and enjoyable to write
155155Python functions that are:
156156
@@ -164,7 +164,7 @@ Avoid the magical wand
164164
165165A powerful tool for hackers, Python comes with a very rich set of hooks and
166166tools 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
168168change how the Python interpreter imports modules, it is even possible (and
169169recommended if needed) to embed C routines in Python.
170170
@@ -222,7 +222,7 @@ output point in the body.
222222
223223There are two main cases for returning values in a function: The result of the function
224224return 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
226226computation or task.
227227
228228If 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
610610added to the end of the line, after the backslash, will break the code and may
611611have 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
614614unclosed parenthesis on an end- of- line the Python interpreter will join the
615615next line until the parenthesis is closed. The same behavior holds for curly
616616and 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