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

Skip to content

Commit 626d472

Browse files
committed
- add several links into the library reference
- update a couple of URLs to point to more recent portions of python.org
1 parent 11b138f commit 626d472

1 file changed

Lines changed: 34 additions & 36 deletions

File tree

Doc/tut/tut.tex

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -329,19 +329,19 @@ \subsection{Source Code Encoding}
329329
possible to directly write Unicode string literals in the selected
330330
encoding. The list of possible encodings can be found in the
331331
\citetitle[../lib/lib.html]{Python Library Reference}, in the section
332-
on \module{codecs}.
332+
on \ulink{\module{codecs}}{../lib/module-codecs.html}.
333333

334-
If your editor supports saving files as \code{UTF-8} with an UTF-8
335-
signature (aka BOM -- Byte Order Mark), you can use that instead of an
334+
If your editor supports saving files as \code{UTF-8} with a UTF-8
335+
\emph{byte order mark} (aka BOM), you can use that instead of an
336336
encoding declaration. IDLE supports this capability if
337337
\code{Options/General/Default Source Encoding/UTF-8} is set. Notice
338338
that this signature is not understood in older Python releases (2.2
339339
and earlier), and also not understood by the operating system for
340-
\code{\#!} files.
340+
\code{\#!} files.
341341

342342
By using UTF-8 (either through the signature or an encoding
343343
declaration), characters of most languages in the world can be used
344-
simultaneously in string literals and comments. Using non-ASCII
344+
simultaneously in string literals and comments. Using non-\ASCII
345345
characters in identifiers is not supported. To display all these
346346
characters properly, your editor must recognize that the file is
347347
UTF-8, and it must use a font that supports all the characters in the
@@ -879,7 +879,7 @@ \subsection{Unicode Strings \label{unicodeStrings}}
879879
\emph{Latin-1}, \emph{ASCII}, \emph{UTF-8}, and \emph{UTF-16}.
880880
The latter two are variable-length encodings that store each Unicode
881881
character in one or more bytes. The default encoding is
882-
normally set to ASCII, which passes through characters in the range
882+
normally set to \ASCII, which passes through characters in the range
883883
0 to 127 and rejects any other characters with an error.
884884
When a Unicode string is printed, written to a file, or converted
885885
with \function{str()}, conversion takes place using this default encoding.
@@ -2393,7 +2393,7 @@ \subsection{The Module Search Path \label{searchPath}}
23932393
script not have the same name as a standard module, or Python will
23942394
attempt to load the script as a module when that module is imported.
23952395
This will generally be an error. See section~\ref{standardModules},
2396-
``Standard Modules.'' for more information.
2396+
``Standard Modules,'' for more information.
23972397

23982398

23992399
\subsection{``Compiled'' Python files}
@@ -2459,9 +2459,10 @@ \subsection{``Compiled'' Python files}
24592459
engineer.
24602460

24612461
\item
2462-
The module \module{compileall}\refstmodindex{compileall} can create
2463-
\file{.pyc} files (or \file{.pyo} files when \programopt{-O} is used) for
2464-
all modules in a directory.
2462+
The module \ulink{\module{compileall}}{../lib/module-compileall.html}%
2463+
{} \refstmodindex{compileall} can create \file{.pyc} files (or
2464+
\file{.pyo} files when \programopt{-O} is used) for all modules in a
2465+
directory.
24652466

24662467
\end{itemize}
24672468

@@ -2478,7 +2479,8 @@ \section{Standard Modules \label{standardModules}}
24782479
also dependson the underlying platform For example,
24792480
the \module{amoeba} module is only provided on systems that somehow
24802481
support Amoeba primitives. One particular module deserves some
2481-
attention: \module{sys}\refstmodindex{sys}, which is built into every
2482+
attention: \ulink{\module{sys}}{../lib/module-sys.html}%
2483+
\refstmodindex{sys}, which is built into every
24822484
Python interpreter. The variables \code{sys.ps1} and
24832485
\code{sys.ps2} define the strings used as primary and secondary
24842486
prompts:
@@ -2761,14 +2763,15 @@ \subsection{Importing * From a Package \label{pkg-import-star}}
27612763
\subsection{Intra-package References}
27622764

27632765
The submodules often need to refer to each other. For example, the
2764-
\module{surround} module might use the \module{echo} module. In fact, such references
2765-
are so common that the \code{import} statement first looks in the
2766+
\module{surround} module might use the \module{echo} module. In fact,
2767+
such references
2768+
are so common that the \keyword{import} statement first looks in the
27662769
containing package before looking in the standard module search path.
27672770
Thus, the surround module can simply use \code{import echo} or
27682771
\code{from echo import echofilter}. If the imported module is not
27692772
found in the current package (the package of which the current module
2770-
is a submodule), the \code{import} statement looks for a top-level module
2771-
with the given name.
2773+
is a submodule), the \keyword{import} statement looks for a top-level
2774+
module with the given name.
27722775

27732776
When packages are structured into subpackages (as with the
27742777
\module{Sound} package in the example), there's no shortcut to refer
@@ -2778,15 +2781,6 @@ \subsection{Intra-package References}
27782781
in the \module{Sound.Effects} package, it can use \code{from
27792782
Sound.Effects import echo}.
27802783

2781-
%(One could design a notation to refer to parent packages, similar to
2782-
%the use of ".." to refer to the parent directory in \UNIX{} and Windows
2783-
%filesystems. In fact, the \module{ni} module, which was the
2784-
%ancestor of this package system, supported this using \code{__} for
2785-
%the package containing the current module,
2786-
%\code{__.__} for the parent package, and so on. This feature was dropped
2787-
%because of its awkwardness; since most packages will have a relative
2788-
%shallow substructure, this is no big loss.)
2789-
27902784
\subsection{Packages in Multiple Directories}
27912785

27922786
Packages support one more special attribute, \member{__path__}. This
@@ -3123,7 +3117,8 @@ \subsection{The \module{pickle} Module \label{pickle}}
31233117
31243118
Rather than have users be constantly writing and debugging code to
31253119
save complicated data types, Python provides a standard module called
3126-
\module{pickle}. This is an amazing module that can take almost
3120+
\ulink{\module{pickle}}{../lib/module-pickle.html}. This is an
3121+
amazing module that can take almost
31273122
any Python object (even some forms of Python code!), and convert it to
31283123
a string representation; this process is called \dfn{pickling}.
31293124
Reconstructing the object from the string representation is called
@@ -3148,12 +3143,15 @@ \subsection{The \module{pickle} Module \label{pickle}}
31483143
31493144
(There are other variants of this, used when pickling many objects or
31503145
when you don't want to write the pickled data to a file; consult the
3151-
complete documentation for \module{pickle} in the Library Reference.)
3152-
3153-
\module{pickle} is the standard way to make Python objects which can
3154-
be stored and reused by other programs or by a future invocation of
3155-
the same program; the technical term for this is a
3156-
\dfn{persistent} object. Because \module{pickle} is so widely used,
3146+
complete documentation for
3147+
\ulink{\module{pickle}}{../lib/module-pickle.html} in the
3148+
\citetitle[../lib/]{Python Library Reference}.)
3149+
3150+
\ulink{\module{pickle}}{../lib/module-pickle.html} is the standard way
3151+
to make Python objects which can be stored and reused by other
3152+
programs or by a future invocation of the same program; the technical
3153+
term for this is a \dfn{persistent} object. Because
3154+
\ulink{\module{pickle}}{../lib/module-pickle.html} is so widely used,
31573155
many authors who write Python extensions take care to ensure that new
31583156
data types such as matrices can be properly pickled and unpickled.
31593157
@@ -4356,8 +4354,8 @@ \chapter{What Now? \label{whatNow}}
43564354
informal site is \url{http://starship.python.net/}, which contains a
43574355
bunch of Python-related personal home pages; many people have
43584356
downloadable software there. Many more user-created Python modules
4359-
can be found in a third-party repository at
4360-
\url{http://www.vex.net/parnassus}.
4357+
can be found in the \ulink{Python Package
4358+
Index}{http://www.python.org/pypi} (PyPI).
43614359
43624360
For Python-related questions and problem reports, you can post to the
43634361
newsgroup \newsgroup{comp.lang.python}, or send them to the mailing
@@ -4370,8 +4368,7 @@ \chapter{What Now? \label{whatNow}}
43704368
% days = 116.9 msgs / day and steadily increasing.
43714369
asking (and answering) questions, suggesting new features, and
43724370
announcing new modules. Before posting, be sure to check the list of
4373-
Frequently Asked Questions (also called the FAQ), at
4374-
\url{http://www.python.org/doc/FAQ.html}, or look for it in the
4371+
\ulink{Frequently Asked Questions}{http://www.python.org/doc/faq/} (also called the FAQ), or look for it in the
43754372
\file{Misc/} directory of the Python source distribution. Mailing
43764373
list archives are available at \url{http://www.python.org/pipermail/}.
43774374
The FAQ answers many of the questions that come up again and again,
@@ -4498,7 +4495,8 @@ \section{Key Bindings \label{keyBindings}}
44984495
is done since the startup file is executed in the same namespace as
44994496
the interactive commands, and removing the names avoids creating side
45004497
effects in the interactive environments. You may find it convenient
4501-
to keep some of the imported modules, such as \module{os}, which turn
4498+
to keep some of the imported modules, such as
4499+
\ulink{\module{os}}{../lib/module-os.html}, which turn
45024500
out to be needed in most sessions with the interpreter.
45034501
45044502
\begin{verbatim}

0 commit comments

Comments
 (0)