Skip to content

Commit 08a477c

Browse files
Update 05_built_in_functions.template
1 parent e1c6748 commit 08a477c

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

templates/05_built_in_functions.template

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ can either be a Unicode string, a Latin-1 encoded string or an AST
151151
object. Refer to the ast module documentation for information on how
152152
to work with AST objects. The filename argument should give the
153153
file from which the code was read; pass some recognizable value if it
154-
wasn�t read from a file ('<string>' is commonly used). The mode
154+
wasnt read from a file ('<string>' is commonly used). The mode
155155
argument specifies what kind of code must be compiled; it can be
156156
'exec' if source consists of a sequence of statements, 'eval' if it
157157
consists of a single expression, or 'single' if it consists of a
@@ -178,7 +178,7 @@ input must be terminated by at least one newline character. This is to
178178
facilitate detection of incomplete and complete statements in the code
179179
module. Warning It is possible to crash the Python interpreter
180180
with a sufficiently large/complex string when compiling to an AST
181-
object due to stack depth limitations in Python�s AST compiler.
181+
object due to stack depth limitations in Pythons AST compiler.
182182
Changed in version 2.3: The flags and dont_inherit arguments were
183183
added. Changed in version 2.6: Support for compiling AST objects.
184184
Changed in version 2.7: Allowed use of Windows and Mac newlines. Also
@@ -205,7 +205,7 @@ delattr(object, name)
205205
-template_end
206206
-template_doc_string_start
207207
This is a relative of setattr(). The arguments are an object and a
208-
string. The string must be the name of one of the object�s attributes.
208+
string. The string must be the name of one of the objects attributes.
209209
The function deletes the named attribute, provided the object allows
210210
it. For example, delattr(x, 'foobar') is equivalent to del x.foobar.
211211
class dict(**kwarg) class dict(mapping, **kwarg) class dict(iterable,
@@ -228,18 +228,18 @@ method will be called and must return the list of attributes. This
228228
allows objects that implement a custom __getattr__() or
229229
__getattribute__() function to customize the way dir() reports their
230230
attributes. If the object does not provide __dir__(), the function
231-
tries its best to gather information from the object�s __dict__
231+
tries its best to gather information from the objects __dict__
232232
attribute, if defined, and from its type object. The resulting list is
233233
not necessarily complete, and may be inaccurate when the object has a
234234
custom __getattr__(). The default dir() mechanism behaves
235235
differently with different types of objects, as it attempts to produce
236236
the most relevant, rather than complete, information: If the
237-
object is a module object, the list contains the names of the module�s
237+
object is a module object, the list contains the names of the modules
238238
attributes. If the object is a type or class object, the list
239239
contains the names of its attributes, and recursively of the
240240
attributes of its bases. Otherwise, the list contains the
241-
object�s attributes names, the names of its class�s attributes, and
242-
recursively of the attributes of its class�s base classes. The
241+
objects attributes names, the names of its classs attributes, and
242+
recursively of the attributes of its classs base classes. The
243243
resulting list is sorted alphabetically. For example: >>> import
244244
struct >>> dir() # show the names in the module namespace
245245
['__builtins__', '__doc__', '__name__', 'struct'] >>> dir(struct)
@@ -308,7 +308,7 @@ provided, locals can be any mapping object. Changed in version
308308
expression argument is parsed and evaluated as a Python expression
309309
(technically speaking, a condition list) using the globals and locals
310310
dictionaries as global and local namespace. If the globals dictionary
311-
is present and lacks __builtins__, the current globals are copied
311+
is present and lacks __builtins__, the current globals are copied
312312
into globals before expression is parsed. This means that expression
313313
normally has full access to the standard __builtin__ module and
314314
restricted environments are propagated. If the locals dictionary is
@@ -320,7 +320,7 @@ x = 1 >>> print eval('x+1') 2 This function can also be
320320
used to execute arbitrary code objects (such as those created by
321321
compile()). In this case pass a code object instead of a string. If
322322
the code object has been compiled with 'exec' as the mode argument,
323-
eval()s return value will be None. Hints: dynamic execution of
323+
eval()s return value will be None. Hints: dynamic execution of
324324
statements is supported by the exec statement. Execution of statements
325325
from a file is supported by the execfile() function. The globals() and
326326
locals() functions returns the current global and local dictionary,
@@ -355,7 +355,7 @@ function locals() below: modifications to the default locals
355355
dictionary should not be attempted. Pass an explicit locals dictionary
356356
if you need to see effects of the code on locals after function
357357
execfile() returns. execfile() cannot be used reliably to modify a
358-
function�s locals.
358+
functions locals.
359359
-template_doc_string_end
360360

361361
-template_context 05_built_in_functions.126
@@ -365,9 +365,9 @@ file(name[, mode[, buffering]])
365365
-template_end
366366
-template_doc_string_start
367367
Constructor function for the file type, described further in
368-
section File Objects. The constructor�s arguments are the same as
368+
section File Objects. The constructors arguments are the same as
369369
those of the open() built-in function described below. When
370-
opening a file, it�s preferable to use open() instead of invoking this
370+
opening a file, its preferable to use open() instead of invoking this
371371
constructor directly. file is more suited to type testing (for
372372
example, writing isinstance(f, file)). New in version 2.2.
373373
-template_doc_string_end
@@ -395,7 +395,7 @@ string, it must contain a possibly signed decimal or floating point
395395
number, possibly embedded in whitespace. The argument may also be
396396
[+|-]nan or [+|-]inf. Otherwise, the argument may be a plain or long
397397
integer or a floating point number, and a floating point number with
398-
the same value (within Python�s floating point precision) is returned.
398+
the same value (within Pythons floating point precision) is returned.
399399
If no argument is given, returns 0.0. Note When passing in a
400400
string, values for NaN and Infinity may be returned, depending on the
401401
underlying C library. Float accepts the strings nan, inf and -inf for
@@ -432,7 +432,7 @@ getattr(object, name[, default])
432432
-template_end
433433
-template_doc_string_start
434434
Return the value of the named attribute of object. name must be a
435-
string. If the string is the name of one of the object�s attributes,
435+
string. If the string is the name of one of the objects attributes,
436436
the result is the value of that attribute. For example, getattr(x,
437437
'foobar') is equivalent to x.foobar. If the named attribute does not
438438
exist, default is returned if provided, otherwise AttributeError is
@@ -458,7 +458,7 @@ hasattr(object, name)
458458
-template_end
459459
-template_doc_string_start
460460
The arguments are an object and a string. The result is True if
461-
the string is the name of one of the object�s attributes, False if
461+
the string is the name of one of the objects attributes, False if
462462
not. (This is implemented by calling getattr(object, name) and seeing
463463
whether it raises an exception or not.)
464464
-template_doc_string_end
@@ -620,7 +620,7 @@ len(s)
620620
may be a sequence (such as a string, bytes, tuple, list, or range) or
621621
a collection (such as a dictionary, set, or frozen set). class
622622
list([iterable]) Return a list whose items are the same and in the
623-
same order as iterable�s items. iterable may be either a sequence, a
623+
same order as iterables items. iterable may be either a sequence, a
624624
container that supports iteration, or an iterator object. If iterable
625625
is already a list, a copy is made and returned, similar to
626626
iterable[:]. For instance, list('abc') returns ['a', 'b', 'c'] and
@@ -769,9 +769,9 @@ open(name[, mode[, buffering]])
769769
-template_doc_string_start
770770
Open a file, returning an object of the file type described in
771771
section File Objects. If the file cannot be opened, IOError is raised.
772-
When opening a file, it�s preferable to use open() instead of invoking
772+
When opening a file, its preferable to use open() instead of invoking
773773
the file constructor directly. The first two arguments are the
774-
same as for stdio�s fopen(): name is the file name to be opened, and
774+
same as for stdios fopen(): name is the file name to be opened, and
775775
mode is a string indicating how the file is to be opened. The most
776776
commonly-used values of mode are 'r' for reading, 'w' for writing
777777
(truncating the file if it already exists), and 'a' for appending
@@ -782,9 +782,9 @@ it defaults to 'r'. The default is to use text mode, which may convert
782782
back on reading. Thus, when opening a binary file, you should append
783783
'b' to the mode value to open the file in binary mode, which will
784784
improve portability. (Appending 'b' is useful even on systems that
785-
don�t treat binary and text files differently, where it serves as
785+
dont treat binary and text files differently, where it serves as
786786
documentation.) See below for more possible values of mode. The
787-
optional buffering argument specifies the file�s desired buffer size:
787+
optional buffering argument specifies the files desired buffer size:
788788
0 means unbuffered, 1 means line buffered, any other positive value
789789
means use a buffer of (approximately) that size (in bytes). A negative
790790
buffering means to use the system default, which is usually line
@@ -793,7 +793,7 @@ omitted, the system default is used. 2 Modes 'r+', 'w+' and 'a+'
793793
open the file for updating (reading and writing); note that 'w+'
794794
truncates the file. Append 'b' to the mode to open the file in binary
795795
mode, on systems that differentiate between binary and text files; on
796-
systems that don�t have this distinction, adding the 'b' has no
796+
systems that dont have this distinction, adding the 'b' has no
797797
effect. In addition to the standard fopen() values mode may be 'U'
798798
or 'rU'. Python is usually built with universal newlines support;
799799
supplying 'U' opens the file as a text file, but lines may be
@@ -823,7 +823,7 @@ object, or the value of the byte when the argument is an 8-bit string.
823823
For example, ord('a') returns the integer 97, ord(u'\u2020') returns
824824
8224. This is the inverse of chr() for 8-bit strings and of unichr()
825825
for unicode objects. If a unicode argument is given and Python was
826-
built with UCS2 Unicode, then the character�s code point must be in
826+
built with UCS2 Unicode, then the characters code point must be in
827827
the range [0..65535] inclusive; otherwise the string length is two,
828828
and a TypeError will be raised.
829829
-template_doc_string_end
@@ -886,7 +886,7 @@ del self._x x = property(getx, setx, delx, "I'm the 'x'
886886
property.") If c is an instance of C, c.x will invoke the getter,
887887
c.x = value will invoke the setter and del c.x the deleter. If
888888
given, doc will be the docstring of the property attribute. Otherwise,
889-
the property will copy fget�s docstring (if it exists). This makes it
889+
the property will copy fgets docstring (if it exists). This makes it
890890
possible to create read-only properties easily using property() as a
891891
decorator: class Parrot(object): def __init__(self):
892892
self._voltage = 100000 @property def voltage(self):
@@ -906,7 +906,7 @@ equivalent to the first example. Be sure to give the additional
906906
functions the same name as the original property (x in this case.)
907907
The returned property object also has the attributes fget, fset, and
908908
fdel corresponding to the constructor arguments. New in version
909-
2.2. Changed in version 2.5: Use fget�s docstring if no doc given.
909+
2.2. Changed in version 2.5: Use fgets docstring if no doc given.
910910
Changed in version 2.6: The getter, setter, and deleter attributes
911911
were added.
912912
-template_doc_string_end
@@ -984,8 +984,8 @@ useful if you have edited the module source file using an external
984984
editor and want to try out the new version without leaving the Python
985985
interpreter. The return value is the module object (the same as the
986986
module argument). When reload(module) is executed: Python
987-
modules code is recompiled and the module-level code reexecuted,
988-
defining a new set of objects which are bound to names in the module�s
987+
modules code is recompiled and the module-level code reexecuted,
988+
defining a new set of objects which are bound to names in the modules
989989
dictionary. The init function of extension modules is not called a
990990
second time. As with all other objects in Python the old
991991
objects are only reclaimed after their reference counts drop to zero.
@@ -994,13 +994,13 @@ changed objects. Other references to the old objects (such as
994994
names external to the module) are not rebound to refer to the new
995995
objects and must be updated in each namespace where they occur if that
996996
is desired. There are a number of other caveats: When a module
997-
is reloaded, its dictionary (containing the module�s global variables)
997+
is reloaded, its dictionary (containing the modules global variables)
998998
is retained. Redefinitions of names will override the old definitions,
999999
so this is generally not a problem. If the new version of a module
10001000
does not define a name that was defined by the old version, the old
1001-
definition remains. This feature can be used to the module�s advantage
1001+
definition remains. This feature can be used to the modules advantage
10021002
if it maintains a global table or cache of objects � with a try
1003-
statement it can test for the table�s presence and skip its
1003+
statement it can test for the tables presence and skip its
10041004
initialization if desired: try: cache except
10051005
NameError: cache = {} It is generally not very useful to
10061006
reload built-in or dynamically loaded modules. Reloading sys,
@@ -1061,8 +1061,8 @@ closest multiple of 10 to the power minus ndigits; if two multiples
10611061
are equally close, rounding is done away from 0 (so, for example,
10621062
round(0.5) is 1.0 and round(-0.5) is -1.0). Note The behavior
10631063
of round() for floats can be surprising: for example, round(2.675, 2)
1064-
gives 2.67 instead of the expected 2.68. This is not a bug: it�s a
1065-
result of the fact that most decimal fractions can�t be represented
1064+
gives 2.67 instead of the expected 2.68. This is not a bug: its a
1065+
result of the fact that most decimal fractions cant be represented
10661066
exactly as a float. See Floating Point Arithmetic: Issues and
10671067
Limitations for more information. class set([iterable]) Return a
10681068
new set object, optionally with elements taken from iterable. set is a
@@ -1165,7 +1165,7 @@ sum(iterable[, start])
11651165
-template_end
11661166
-template_doc_string_start
11671167
Sums start and the items of an iterable from left to right and
1168-
returns the total. start defaults to 0. The iterable�s items are
1168+
returns the total. start defaults to 0. The iterables items are
11691169
normally numbers, and the start value is not allowed to be a string.
11701170
For some use cases, there are good alternatives to sum(). The
11711171
preferred, fast way to concatenate a sequence of strings is by calling
@@ -1227,7 +1227,7 @@ tuple([iterable])
12271227
-template_end
12281228
-template_doc_string_start
12291229
Return a tuple whose items are the same and in the same order as
1230-
iterable�s items. iterable may be a sequence, a container that
1230+
iterables items. iterable may be a sequence, a container that
12311231
supports iteration, or an iterator object. If iterable is already a
12321232
tuple, it is returned unchanged. For instance, tuple('abc') returns
12331233
('a', 'b', 'c') and tuple([1, 2, 3]) returns (1, 2, 3). If no argument
@@ -1336,7 +1336,7 @@ the same values as the corresponding list, without actually storing
13361336
them all simultaneously. The advantage of xrange() over range() is
13371337
minimal (since xrange() still has to create the values when asked for
13381338
them) except when a very large range is used on a memory-starved
1339-
machine or when all of the range�s elements are never used (such as
1339+
machine or when all of the ranges elements are never used (such as
13401340
when the loop is usually terminated with break). For more information
13411341
on xrange objects, see XRange Type and Sequence Types � str, unicode,
13421342
list, tuple, bytearray, buffer, xrange. CPython implementation

0 commit comments

Comments
 (0)