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

Skip to content

Commit 907e76b

Browse files
committed
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more difficult for non-native speakers.
1 parent 19b1c61 commit 907e76b

17 files changed

Lines changed: 105 additions & 98 deletions

Doc/lib/libos.tex

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ \section{\module{os} ---
1313
\module{mac} or \refmodule{posix} and exports the same functions and data
1414
as found there. The design of all Python's built-in OS dependent
1515
modules is such that as long as the same functionality is available,
16-
it uses the same interface; e.g., the function
16+
it uses the same interface; for example, the function
1717
\code{os.stat(\var{path})} returns stat information about \var{path} in
1818
the same format (which happens to have originated with the
1919
\POSIX{} interface).
@@ -42,9 +42,9 @@ \section{\module{os} ---
4242

4343

4444
\begin{excdesc}{error}
45-
This exception is raised when a function returns a
46-
system-related error (e.g., not for illegal argument types). This is
47-
also known as the built-in exception \exception{OSError}. The
45+
This exception is raised when a function returns a system-related
46+
error (not for illegal argument types or other incidental errors).
47+
This is also known as the built-in exception \exception{OSError}. The
4848
accompanying value is a pair containing the numeric error code from
4949
\cdata{errno} and the corresponding string, as would be printed by the
5050
C function \cfunction{perror()}. See the module
@@ -55,7 +55,7 @@ \section{\module{os} ---
5555
\member{errno} and \member{strerror}. The first holds the value of
5656
the C \cdata{errno} variable, and the latter holds the corresponding
5757
error message from \cfunction{strerror()}. For exceptions that
58-
involve a file system path (e.g. \function{chdir()} or
58+
involve a file system path (such as \function{chdir()} or
5959
\function{unlink()}), the exception instance will contain a third
6060
attribute, \member{filename}, which is the file name passed to the
6161
function.
@@ -72,10 +72,11 @@ \section{\module{os} ---
7272

7373
\begin{datadesc}{path}
7474
The corresponding OS dependent standard module for pathname
75-
operations, e.g., \module{posixpath} or \module{macpath}. Thus, given
76-
the proper imports, \code{os.path.split(\var{file})} is equivalent to but
77-
more portable than \code{posixpath.split(\var{file})}. Note that this
78-
is also a valid module: it may be imported directly as
75+
operations, such as \module{posixpath} or \module{macpath}. Thus,
76+
given the proper imports, \code{os.path.split(\var{file})} is
77+
equivalent to but more portable than
78+
\code{posixpath.split(\var{file})}. Note that this is also an
79+
importable module: it may be imported directly as
7980
\refmodule{os.path}.
8081
\end{datadesc}
8182

@@ -858,15 +859,15 @@ \subsection{Process Management \label{os-process}}
858859

859860
\begin{funcdesc}{execv}{path, args}
860861
Execute the executable \var{path} with argument list \var{args},
861-
replacing the current process (i.e., the Python interpreter).
862+
replacing the current process (the Python interpreter).
862863
The argument list may be a tuple or list of strings.
863864
Availability: \UNIX{}, Windows.
864865
\end{funcdesc}
865866

866867
\begin{funcdesc}{execve}{path, args, env}
867868
Execute the executable \var{path} with argument list \var{args},
868-
and environment \var{env},
869-
replacing the current process (i.e., the Python interpreter).
869+
and environment \var{env}, replacing the current process (the Python
870+
interpreter).
870871
The argument list may be a tuple or list of strings.
871872
The environment must be a dictionary mapping strings to strings.
872873
Availability: \UNIX{}, Windows.
@@ -1150,20 +1151,20 @@ \subsection{Miscellaneous System Information \label{os-path}}
11501151

11511152

11521153
\begin{datadesc}{curdir}
1153-
The constant string used by the OS to refer to the current directory,
1154-
e.g.\ \code{'.'} for \POSIX{} or \code{':'} for the Macintosh.
1154+
The constant string used by the OS to refer to the current directory.
1155+
For example: \code{'.'} for \POSIX{} or \code{':'} for the Macintosh.
11551156
\end{datadesc}
11561157

11571158
\begin{datadesc}{pardir}
1158-
The constant string used by the OS to refer to the parent directory,
1159-
e.g.\ \code{'..'} for \POSIX{} or \code{'::'} for the Macintosh.
1159+
The constant string used by the OS to refer to the parent directory.
1160+
For example: \code{'..'} for \POSIX{} or \code{'::'} for the Macintosh.
11601161
\end{datadesc}
11611162

11621163
\begin{datadesc}{sep}
11631164
The character used by the OS to separate pathname components,
1164-
e.g.\ \character{/} for \POSIX{} or \character{:} for the Macintosh.
1165-
Note that knowing this is not sufficient to be able to parse or
1166-
concatenate pathnames --- use \function{os.path.split()} and
1165+
for example, \character{/} for \POSIX{} or \character{:} for the
1166+
Macintosh. Note that knowing this is not sufficient to be able to
1167+
parse or concatenate pathnames --- use \function{os.path.split()} and
11671168
\function{os.path.join()} --- but it is occasionally useful.
11681169
\end{datadesc}
11691170

@@ -1175,7 +1176,7 @@ \subsection{Miscellaneous System Information \label{os-path}}
11751176

11761177
\begin{datadesc}{pathsep}
11771178
The character conventionally used by the OS to separate search patch
1178-
components (as in \envvar{PATH}), e.g.\ \character{:} for \POSIX{} or
1179+
components (as in \envvar{PATH}), such as \character{:} for \POSIX{} or
11791180
\character{;} for DOS and Windows.
11801181
\end{datadesc}
11811182

@@ -1186,7 +1187,7 @@ \subsection{Miscellaneous System Information \label{os-path}}
11861187

11871188
\begin{datadesc}{linesep}
11881189
The string used to separate (or, rather, terminate) lines on the
1189-
current platform. This may be a single character,
1190-
e.g.\ \code{'\e n'} for \POSIX{} or \code{'\e r'} for MacOS, or multiple
1191-
characters, e.g.\ \code{'\e r\e n'} for MS-DOS and MS Windows.
1190+
current platform. This may be a single character, such as \code{'\e
1191+
n'} for \POSIX{} or \code{'\e r'} for MacOS, or multiple characters,
1192+
for example, \code{'\e r\e n'} for MS-DOS and MS Windows.
11921193
\end{datadesc}

Doc/lib/libprofile.tex

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ \section{Reference Manual}
319319
is the quotient of \code{tottime} divided by \code{ncalls}
320320

321321
\item[cumtime ]
322-
is the total time spent in this and all subfunctions (i.e., from
323-
invocation till exit). This figure is accurate \emph{even} for recursive
322+
is the total time spent in this and all subfunctions (from invocation
323+
till exit). This figure is accurate \emph{even} for recursive
324324
functions.
325325

326326
\item[percall ]
@@ -331,11 +331,11 @@ \section{Reference Manual}
331331

332332
\end{description}
333333

334-
When there are two numbers in the first column (e.g.: \samp{43/3}),
335-
then the latter is the number of primitive calls, and the former is
336-
the actual number of calls. Note that when the function does not
337-
recurse, these two values are the same, and only the single figure is
338-
printed.
334+
When there are two numbers in the first column (for example,
335+
\samp{43/3}), then the latter is the number of primitive calls, and
336+
the former is the actual number of calls. Note that when the function
337+
does not recurse, these two values are the same, and only the single
338+
figure is printed.
339339

340340
\end{funcdesc}
341341

@@ -355,7 +355,7 @@ \section{Reference Manual}
355355
the corresponding version of \module{profile}. To be specific, there is
356356
\emph{no} file compatibility guaranteed with future versions of this
357357
profiler, and there is no compatibility with files produced by other
358-
profilers (e.g., the old system profiler).
358+
profilers (such as the old system profiler).
359359

360360
If several files are provided, all the statistics for identical
361361
functions will be coalesced, so that an overall view of several
@@ -377,7 +377,7 @@ \subsection{The \class{Stats} Class \label{profile-stats}}
377377
performing a strip operation, the object is considered to have its
378378
entries in a ``random'' order, as it was just after object
379379
initialization and loading. If \method{strip_dirs()} causes two
380-
function names to be indistinguishable (i.e., they are on the same
380+
function names to be indistinguishable (they are on the same
381381
line of the same filename, and have the same function name), then the
382382
statistics for these two entries are accumulated into a single entry.
383383
\end{methoddesc}
@@ -423,7 +423,7 @@ \subsection{The \class{Stats} Class \label{profile-stats}}
423423

424424
Note that all sorts on statistics are in descending order (placing
425425
most time consuming items first), where as name, file, and line number
426-
searches are in ascending order (i.e., alphabetical). The subtle
426+
searches are in ascending order (alphabetical). The subtle
427427
distinction between \code{'nfl'} and \code{'stdname'} is that the
428428
standard name is a sort of the name as printed, which means that the
429429
embedded line numbers get compared in an odd way. For example, lines
@@ -538,10 +538,10 @@ \section{Limitations \label{profile-limits}}
538538
is once again executing. As a result, functions that are called many
539539
times, or call many functions, will typically accumulate this error.
540540
The error that accumulates in this fashion is typically less than the
541-
accuracy of the clock (i.e., less than one clock tick), but it
541+
accuracy of the clock (less than one clock tick), but it
542542
\emph{can} accumulate and become very significant. This profiler
543543
provides a means of calibrating itself for a given platform so that
544-
this error can be probabilistically (i.e., on the average) removed.
544+
this error can be probabilistically (on the average) removed.
545545
After the profiler is calibrated, it will be more accurate (in a least
546546
square sense), but it will sometimes produce negative numbers (when
547547
call counts are exceptionally low, and the gods of probability work
@@ -695,8 +695,8 @@ \subsection{OldProfile Class \label{profile-old}}
695695

696696
The following derived profiler simulates the old style profiler,
697697
providing errant results on recursive functions. The reason for the
698-
usefulness of this profiler is that it runs faster (i.e., less
699-
overhead) than the old profiler. It still creates all the caller
698+
usefulness of this profiler is that it runs faster (less
699+
overhead) than the new profiler. It still creates all the caller
700700
stats, and is quite useful when there is \emph{no} recursion in the
701701
user's code. It is also a lot more accurate than the old profiler, as
702702
it does not charge all its overhead time to the user's code.

Doc/lib/libre.tex

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,10 @@ \subsection{Regular Expression Syntax \label{re-syntax}}
229229

230230
For example, if the pattern is
231231
\regexp{(?P<id>[a-zA-Z_]\e w*)}, the group can be referenced by its
232-
name in arguments to methods of match objects, such as \code{m.group('id')}
233-
or \code{m.end('id')}, and also by name in pattern text
234-
(e.g. \regexp{(?P=id)}) and replacement text (e.g. \code{\e g<id>}).
232+
name in arguments to methods of match objects, such as
233+
\code{m.group('id')} or \code{m.end('id')}, and also by name in
234+
pattern text (for example, \regexp{(?P=id)}) and replacement text
235+
(such as \code{\e g<id>}).
235236

236237
\item[\code{(?P=\var{name})}] Matches whatever text was matched by the
237238
earlier group named \var{name}.
@@ -516,7 +517,7 @@ \subsection{Module Contents}
516517

517518
The pattern may be a string or an RE object; if you need to specify
518519
regular expression flags, you must use a RE object, or use
519-
embedded modifiers in a pattern; e.g.
520+
embedded modifiers in a pattern; for example,
520521
\samp{sub("(?i)b+", "x", "bbbb BBBB")} returns \code{'x x'}.
521522

522523
The optional argument \var{count} is the maximum number of pattern
@@ -555,9 +556,10 @@ \subsection{Module Contents}
555556

556557
\begin{excdesc}{error}
557558
Exception raised when a string passed to one of the functions here
558-
is not a valid regular expression (e.g., unmatched parentheses) or
559-
when some other error occurs during compilation or matching. It is
560-
never an error if a string contains no match for a pattern.
559+
is not a valid regular expression (for example, it might contain
560+
unmatched parentheses) or when some other error occurs during
561+
compilation or matching. It is never an error if a string contains
562+
no match for a pattern.
561563
\end{excdesc}
562564

563565

@@ -654,7 +656,7 @@ \subsection{Match Objects \label{match-objects}}
654656
Returns one or more subgroups of the match. If there is a single
655657
argument, the result is a single string; if there are
656658
multiple arguments, the result is a tuple with one item per argument.
657-
Without arguments, \var{group1} defaults to zero (i.e. the whole match
659+
Without arguments, \var{group1} defaults to zero (the whole match
658660
is returned).
659661
If a \var{groupN} argument is zero, the corresponding return value is the
660662
entire matching string; if it is in the inclusive range [1..99], it is

Doc/lib/librexec.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ \section{\module{rexec} ---
3232
instance that was passed to or created by its constructor. (Actually,
3333
the \class{RExec} object doesn't make these calls --- they are made by
3434
a module loader object that's part of the \class{RExec} object. This
35-
allows another level of flexibility, e.g. using packages.)
35+
allows another level of flexibility, which can be useful when changing
36+
the mechanics of \keyword{import} within the restricted environment.)
3637

3738
By providing an alternate \class{RHooks} object, we can control the
3839
file system accesses made to import a module, without changing the
@@ -135,7 +136,7 @@ \subsection{RExec Objects \label{rexec-objects}}
135136
\end{methoddesc}
136137

137138
\begin{methoddesc}{r_unload}{module}
138-
Unload the module object \var{module} (i.e., remove it from the
139+
Unload the module object \var{module} (remove it from the
139140
restricted environment's \code{sys.modules} dictionary).
140141
\end{methoddesc}
141142

Doc/lib/librlcompleter.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ \subsection{Completer Objects \label{completer-objects}}
5757
keywords (as defined by the \refmodule{keyword} module).
5858

5959
If called for a dotted name, it will try to evaluate anything without
60-
obvious side-effects (i.e., functions will not be evaluated, but it
60+
obvious side-effects (functions will not be evaluated, but it
6161
can generate calls to \method{__getattr__()}) upto the last part, and
6262
find matches for the rest via the \function{dir()} function.
6363
\end{methoddesc}

Doc/lib/libsha.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ \section{\module{sha} ---
4242
\begin{methoddesc}[sha]{update}{arg}
4343
Update the sha object with the string \var{arg}. Repeated calls are
4444
equivalent to a single call with the concatenation of all the
45-
arguments, i.e.\ \code{m.update(a); m.update(b)} is equivalent to
45+
arguments: \code{m.update(a); m.update(b)} is equivalent to
4646
\code{m.update(a+b)}.
4747
\end{methoddesc}
4848

Doc/lib/libsignal.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ \section{\module{signal} ---
1212

1313
\item
1414
A handler for a particular signal, once set, remains installed until
15-
it is explicitly reset (i.e. Python emulates the BSD style interface
15+
it is explicitly reset (Python emulates the BSD style interface
1616
regardless of the underlying implementation), with the exception of
1717
the handler for \constant{SIGCHLD}, which follows the underlying
1818
implementation.
@@ -25,8 +25,8 @@ \section{\module{signal} ---
2525
Although Python signal handlers are called asynchronously as far as
2626
the Python user is concerned, they can only occur between the
2727
``atomic'' instructions of the Python interpreter. This means that
28-
signals arriving during long calculations implemented purely in \C{}
29-
(e.g.\ regular expression matches on large bodies of text) may be
28+
signals arriving during long calculations implemented purely in C
29+
(such as regular expression matches on large bodies of text) may be
3030
delayed for an arbitrary amount of time.
3131

3232
\item
@@ -97,7 +97,7 @@ \section{\module{signal} ---
9797
\begin{funcdesc}{alarm}{time}
9898
If \var{time} is non-zero, this function requests that a
9999
\constant{SIGALRM} signal be sent to the process in \var{time} seconds.
100-
Any previously scheduled alarm is canceled (i.e.\ only one alarm can
100+
Any previously scheduled alarm is canceled (only one alarm can
101101
be scheduled at any time). The returned value is then the number of
102102
seconds before any previously set alarm was to have been delivered.
103103
If \var{time} is zero, no alarm id scheduled, and any scheduled

0 commit comments

Comments
 (0)