Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6c4f003

Browse files
committed
changes (suggested) by Soren Larsen
1 parent d01c100 commit 6c4f003

28 files changed

Lines changed: 92 additions & 80 deletions

Doc/lib/libarray.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ \section{Built-in module \sectcode{array}}
6363
\end{funcdesc}
6464

6565
\begin{funcdesc}{fromlist}{list}
66-
Appends items from the list. This is equivalent to
67-
\code{for x in \var{list}: a.append(x)}
66+
Append items from the list. This is equivalent to
67+
\code{for x in \var{list}:\ a.append(x)}
6868
except that if there is a type error, the array is unchanged.
6969
\end{funcdesc}
7070

Doc/lib/libcgi.tex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ \section{Built-in module \sectcode{cgi}}
6262
the form was submitted through a POST request). The keys in the
6363
resulting dictionary are the field names used in the submission; the
6464
values are {\em lists} of the field values (since field name may be
65-
used multiple times in a single form). As a side effect, it sets
65+
used multiple times in a single form). \samp{\%} escapes in the
66+
values are translated to their single-character equivalent using
67+
\code{urllib.unquote()}. As a side effect, this function sets
6668
\code{environ['QUERY_STRING']} to the raw query string, if it isn't
6769
already set.
6870
\end{funcdesc}
@@ -79,7 +81,9 @@ \section{Built-in module \sectcode{cgi}}
7981
\end{funcdesc}
8082

8183
\begin{funcdesc}{print_form}{form}
82-
Print a piece of HTML text showing the contents of the \var{form}.
84+
Print a piece of HTML text showing the contents of the \var{form} (a
85+
dictionary, an instance of the \code{FormContentDict} class defined
86+
below, or a subclass thereof).
8387
This is mainly useful when debugging a CGI script.
8488
\end{funcdesc}
8589

Doc/lib/libfuncs.tex

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ \section{Built-in Functions}
4242

4343
\begin{funcdesc}{compile}{string\, filename\, kind}
4444
Compile the \var{string} into a code object. Code objects can be
45-
executed by a \code{exec()} statement or evaluated by a call to
45+
executed by an \code{exec} statement or evaluated by a call to
4646
\code{eval()}. The \var{filename} argument should
4747
give the file from which the code was read; pass e.g. \code{'<string>'}
4848
if it wasn't read from a file. The \var{kind} argument specifies
@@ -56,7 +56,7 @@ \section{Built-in Functions}
5656
object and a string. The string must be the name
5757
of one of the object's attributes. The function deletes
5858
the named attribute, provided the object allows it. For example,
59-
\code{setattr(\var{x}, '\var{foobar}')} is equivalent to
59+
\code{delattr(\var{x}, '\var{foobar}')} is equivalent to
6060
\code{del \var{x}.\var{foobar}}.
6161
\end{funcdesc}
6262

@@ -106,13 +106,15 @@ \section{Built-in Functions}
106106
\end{verbatim}\ecode
107107

108108
This function can also be used to execute arbitrary code objects
109-
(e.g. created by \code{compile()}). In this case pass a code
109+
(e.g.\ created by \code{compile()}). In this case pass a code
110110
object instead of a string. The code object must have been compiled
111111
passing \code{'eval'} to the \var{kind} argument.
112112

113-
Note: dynamic execution of statements is supported by the
113+
Hints: dynamic execution of statements is supported by the
114114
\code{exec} statement. Execution of statements from a file is
115-
supported by the \code{execfile()} function.
115+
supported by the \code{execfile()} function. The \code{vars()}
116+
function returns the current local dictionary, which may be useful
117+
to pass around for use by \code{eval()} or \code{execfile()}.
116118

117119
\end{funcdesc}
118120

@@ -138,7 +140,7 @@ \section{Built-in Functions}
138140
\var{function} returns true. If \var{list} is a string or a tuple,
139141
the result also has that type; otherwise it is always a list. If
140142
\var{function} is \code{None}, the identity function is assumed,
141-
i.e. all elements of \var{list} that are false (zero or empty) are
143+
i.e.\ all elements of \var{list} that are false (zero or empty) are
142144
removed.
143145
\end{funcdesc}
144146

@@ -268,7 +270,7 @@ \section{Built-in Functions}
268270
\begin{funcdesc}{pow}{x\, y\optional{\, z}}
269271
Return \var{x} to the power \var{y}; if \var{z} is present, return
270272
\var{x} to the power \var{y}, modulo \var{z} (computed more
271-
efficiently that \code{pow(\var{x}, \var{y}) \% \var{z}}).
273+
efficiently than \code{pow(\var{x}, \var{y}) \% \var{z}}).
272274
The arguments must have
273275
numeric types. With mixed operand types, the rules for binary
274276
arithmetic operators apply. The effective operand type is also the
@@ -378,7 +380,7 @@ \section{Built-in Functions}
378380
\begin{funcdesc}{str}{object}
379381
Return a string containing a nicely printable representation of an
380382
object. For strings, this returns the string itself. The difference
381-
with \code{repr(\var{object}} is that \code{str(\var{object}} does not
383+
with \code{repr(\var{object})} is that \code{str(\var{object})} does not
382384
always attempt to return a string that is acceptable to \code{eval()};
383385
its goal is to return a printable string.
384386
\end{funcdesc}
@@ -412,7 +414,7 @@ \section{Built-in Functions}
412414
corresponding symbol table are undefined.%
413415
\footnote{In the current implementation, local variable bindings
414416
cannot normally be affected this way, but variables retrieved from
415-
other scopes can be. This may change.}
417+
other scopes (e.g. modules) can be. This may change.}
416418
\end{funcdesc}
417419

418420
\begin{funcdesc}{xrange}{\optional{start\,} end\optional{\, step}}

Doc/lib/libhttplib.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ \section{Built-in module \sectcode{httplib}}
66

77
This module defines a class which implements the client side of the
88
HTTP protocol. It is normally not used directly --- the module
9-
\code{urlllib} module uses it to handle URLs that use HTTP.
9+
\code{urllib} uses it to handle URLs that use HTTP.
1010
\stmodindex{urllib}
1111

1212
The module defines one class, \code{HTTP}. An \code{HTTP} instance
@@ -80,7 +80,7 @@ \section{Built-in module \sectcode{httplib}}
8080
Complete the request by shutting down the sending end of the socket,
8181
read the reply from the server, and return a triple (\var{replycode},
8282
\var{message}, \var{headers}). Here \var{replycode} is the integer
83-
reply code from the request (e.g. \code{200} if the request was
83+
reply code from the request (e.g.\ \code{200} if the request was
8484
handled properly); \var{message} is the message string corresponding
8585
to the reply code; and \var{header} is an instance of the class
8686
\code{rfc822.Message} containing the headers received from the server.

Doc/lib/libimp.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ \section{Built-in module \sectcode{imp}}
22
\bimodindex{imp}
33
\index{import}
44

5-
This module provides an interface to the mechanisms use to implement
5+
This module provides an interface to the mechanisms used to implement
66
the \code{import} statement. It defines the following constants and
77
functions:
88

Doc/lib/libpdb.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ \subsection{Debugger Commands}
9999
command (but not ``\code{he}'' or ``\code{hel}'', nor ``\code{H}'' or
100100
``\code{Help} or ``\code{HELP}''). Arguments to commands must be
101101
separated by whitespace (spaces or tabs). Optional arguments are
102-
enclosed in square brackets (``\code{[]}'')in the command syntax; the
102+
enclosed in square brackets (``\code{[]}'') in the command syntax; the
103103
square brackets must not be typed. Alternatives in the command syntax
104104
are separated by a vertical bar (``\code{|}'').
105105

Doc/lib/libprofile.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ \chapter{The Python Profiler}
66

77
Written by James Roskind%
88
\footnote{
9-
Updated and converted to LaTeX by Guido van Rossum. The references to
9+
Updated and converted to \LaTeX\ by Guido van Rossum. The references to
1010
the old profiler are left in the text, although it no longer exists.
1111
}
1212

Doc/lib/libregex.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ \section{Built-in Module \sectcode{regex}}
1919
they are followed by an unrecognized escape character.
2020
\emph{However}, if you want to include a literal \dfn{backslash} in a
2121
regular expression represented as a string literal, you have to
22-
\emph{quadruple} it. E.g. to extract LaTeX \samp{\e section\{{\rm
22+
\emph{quadruple} it. E.g.\ to extract \LaTeX\ \samp{\e section\{{\rm
2323
\ldots}\}} headers from a document, you can use this pattern:
2424
\code{'\e \e \e\e section\{\e (.*\e )\}'}.
2525

@@ -84,7 +84,7 @@ \section{Built-in Module \sectcode{regex}}
8484

8585
\begin{funcdesc}{symcomp}{pattern\optional{\, translate}}
8686
This is like \code{compile}, but supports symbolic group names: if a
87-
parentheses-enclosed group begins with a group name in angular
87+
parenthesis-enclosed group begins with a group name in angular
8888
brackets, e.g. \code{'\e(<id>[a-z][a-z0-9]*\e)'}, the group can
8989
be referenced by its name in arguments to the \code{group} method of
9090
the resulting compiled regular expression object, like this:

Doc/lib/librfc822.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ \section{Built-in module \sectcode{rfc822}}
2929
\end{funcdesc}
3030

3131
\begin{funcdesc}{getallmatchingheaders}{name}
32-
Return a list of lines consisting of all headers whose header matches
32+
Return a list of lines consisting of all headers matching
3333
\var{name}, if any. Each physical line, whether it is a continuation
3434
line or not, is a separate list item. Return the empty list if no
3535
header matches \var{name}.
@@ -60,12 +60,12 @@ \section{Built-in module \sectcode{rfc822}}
6060
\var{name} exists, return \code{None, None}; otherwise both the full
6161
name and the address are (possibly empty )strings.
6262

63-
Example: if \code{m}'s first \code{From} header contains the string
63+
Example: If \code{m}'s first \code{From} header contains the string
6464
\code{'[email protected] (Guido van Rossum)'}, then
6565
\code{m.getaddr('From')} will yield the pair
66-
\code{('Guido van Rossum', 'guido\@cwi.nl')}.
66+
\code{('Guido van Rossum', '[email protected]')}.
6767
If the header contained
68-
\code{'Guido van Rossum <guido\@cwi.nl>'} instead, it would yield the
68+
\code{'Guido van Rossum <[email protected]>'} instead, it would yield the
6969
exact same result.
7070
\end{funcdesc}
7171

@@ -82,7 +82,7 @@ \section{Built-in module \sectcode{rfc822}}
8282

8383
\begin{funcdesc}{getdate}{name}
8484
Retrieve a header using \code{getheader} and parse it into a 9-tuple
85-
compatible with \code{time.kmtime()}. If there is no header matching
85+
compatible with \code{time.mktime()}. If there is no header matching
8686
\var{name}, or it is unparsable, return \code{None}.
8787

8888
Date parsing appears to be a black art, and not all mailers adhere to

Doc/lib/libsgmllib.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ \section{Built-in module \sectcode{sgmllib}}
77
This module defines a class \code{SGMLParser} which serves as the
88
basis for parsing text files formatted in SGML (Standard Generalized
99
Mark-up Language). In fact, it does not provide a full SGML parser
10-
--- it only parses SGML insofar as it is used by HTML, and module only
10+
--- it only parses SGML insofar as it is used by HTML, and the module only
1111
exists as a basis for the \code{htmllib} module.
1212
\stmodindex{htmllib}
1313

@@ -77,8 +77,8 @@ \section{Built-in module \sectcode{sgmllib}}
7777
``\code{\&\var{ref};}'' where \var{ref} is an alphabetic entity
7878
reference. It looks for \var{ref} in the instance (or class)
7979
variable \code{entitydefs} which should give the entity's translation.
80-
If a translation is found, it callse the method \code{handle_data()}
81-
with the translation; otherwise, it callse the method
80+
If a translation is found, it calls the method \code{handle_data()}
81+
with the translation; otherwise, it calls the method
8282
\code{unknown_entityref(\var{ref})}.
8383
\end{funcdesc}
8484

@@ -142,7 +142,7 @@ \section{Built-in module \sectcode{sgmllib}}
142142
143143
Note that the parser maintains a stack of opening tags for which no
144144
matching closing tag has been found yet. Only tags processed by
145-
\code{start_\var{tag}()} are pushed on this stack. Definition if a
145+
\code{start_\var{tag}()} are pushed on this stack. Definition of a
146146
\code{end_\var{tag}()} method is optional for these tags. For tags
147147
processed by \code{do_\var{tag}()} or by \code{unknown_tag()}, no
148148
\code{end_\var{tag}()} method must be defined.

0 commit comments

Comments
 (0)