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

Skip to content

Commit ecde781

Browse files
committed
restructured library manual accordiung to functional group
1 parent 557ed94 commit ecde781

55 files changed

Lines changed: 883 additions & 259 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ ref.dvi: ref.tex ref1.tex ref2.tex ref3.tex ref4.tex ref5.tex ref6.tex \
9898

9999
# LaTeX source files for the Python Library Reference
100100
LIBFILES = lib.tex \
101-
libal.tex libaifc.tex libamoeba.tex libarray.tex libaudio.tex libaudioop.tex \
101+
libal.tex libaifc.tex liballos.tex \
102+
libamoeba.tex libarray.tex libaudio.tex libaudioop.tex \
102103
libbltin.tex \
103104
libcd.tex \
104105
libcgi.tex libcopy.tex libctb.tex libcrypto.tex \
@@ -112,16 +113,17 @@ libjpeg.tex \
112113
libmac.tex libmacconsole.tex libmacdnr.tex \
113114
libmacfs.tex libmactcp.tex libmacspeech.tex \
114115
libmain.tex libmarshal.tex libmath.tex \
115-
libmd5.tex libmimetools.tex libmm.tex libmods.tex libmpz.tex \
116+
libmd5.tex libmimetools.tex libmisc.tex \
117+
libmm.tex libmods.tex libmpz.tex \
116118
libnntplib.tex \
117119
libobjs.tex libos.tex \
118120
libpanel.tex libpickle.tex libposix.tex libposixfile.tex \
119-
libppath.tex libprofile.tex libpwd.tex \
121+
libppath.tex libprofile.tex libpwd.tex libpython.tex \
120122
librand.tex libregex.tex libregsub.tex \
121123
librfc822.tex librgbimg.tex librotor.tex \
122124
libselect.tex libsgi.tex libsgmllib.tex \
123-
libshelve.tex libsocket.tex libstd.tex libstdwin.tex \
124-
libstring.tex libstruct.tex libsun.tex libsys.tex \
125+
libshelve.tex libsocket.tex libsomeos.tex libstd.tex libstdwin.tex \
126+
libstring.tex libstrings.tex libstruct.tex libsun.tex libsys.tex \
125127
libtempfile.tex libthread.tex libtime.tex \
126128
libtraceback.tex libtypes.tex libtypes2.tex \
127129
libunix.tex liburllib.tex liburlparse.tex \

Doc/lib.tex

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
\begin{abstract}
2323

2424
\noindent
25-
This document describes the built-in types, exceptions and functions
26-
and the standard modules that come with the Python system. It assumes
25+
This document describes the built-in and standard types, exceptions,
26+
functions and modules that come with the Python system. It assumes
2727
basic knowledge about the Python language. For an informal
2828
introduction to the language, see the {\em Python Tutorial}. The {\em
2929
Python Reference Manual} gives a more formal definition of the
@@ -51,52 +51,58 @@
5151
\input{libexcs}
5252
\input{libfuncs}
5353

54-
\input{libmods} % Built-in modules
54+
\input{libpython} % Python Services
5555
\input{libsys}
56-
\input{libbltin} % really __builtin__
56+
\input{libtypes2} % types is already taken :-(
57+
\input{libtraceback}
58+
\input{libpickle}
59+
\input{libshelve}
60+
\input{libcopy}
61+
\input{libmarshal}
5762
\input{libimp}
63+
\input{libbltin} % really __builtin__
5864
\input{libmain} % really __main__
59-
\input{libarray}
60-
\input{libmath}
61-
\input{libtime}
65+
66+
\input{libstrings} % String Services
67+
\input{libstring}
6268
\input{libregex}
63-
\input{libmarshal}
69+
\input{libregsub}
6470
\input{libstruct}
6571

66-
\input{libstd} % Standard Modules
67-
\input{libgetopt}
68-
\input{libos}
72+
\input{libmisc} % Miscellaneous Services
73+
\input{libmath}
6974
\input{librand}
70-
\input{libregsub}
71-
\input{libstring}
7275
\input{libwhrandom}
73-
\input{libaifc}
74-
\input{libpickle}
75-
\input{libshelve}
76-
\input{libcopy}
77-
\input{libtypes2} % types is already taken :-(
78-
\input{libtempfile}
79-
\input{libtraceback}
76+
\input{libarray}
8077

81-
\input{libpdb} % The Python Debugger
78+
\input{liballos} % Generic Operating System Services
79+
\input{libos}
80+
\input{libtime}
81+
\input{libgetopt}
82+
\input{libtempfile}
8283

83-
\input{libprofile} % The Python Profiler
84+
\input{libsomeos} % Optional Operating System Services
85+
\input{libsignal}
86+
\input{libsocket}
87+
\input{libselect}
88+
\input{libthread}
8489

85-
\input{libunix} % UNIX ONLY
90+
\input{libunix} % UNIX Specific Services
91+
\input{libposix}
92+
\input{libppath} % == posixpath
93+
\input{libpwd}
94+
\input{libgrp}
8695
\input{libdbm}
87-
\input{libfcntl}
8896
\input{libgdbm}
89-
\input{libgrp}
90-
\input{libposix}
97+
\input{libtermios}
98+
\input{libfcntl}
9199
\input{libposixfile}
92-
\input{libppath} % really posixpath
93-
\input{libpwd}
94-
\input{libselect}
95-
\input{libsignal}
96-
\input{libsocket}
97-
\input{libthread}
98100

99-
\input{libwww} % WWW EXTENSIONS
101+
\input{libpdb} % The Python Debugger
102+
103+
\input{libprofile} % The Python Profiler
104+
105+
\input{libwww} % Internet and WWW Services
100106
\input{libcgi}
101107
\input{liburllib}
102108
\input{libhttplib}
@@ -109,13 +115,14 @@
109115
\input{librfc822}
110116
\input{libmimetools}
111117

112-
\input{libmm} % MULTIMEDIA EXTENSIONS
118+
\input{libmm} % Multimedia Services
113119
\input{libaudioop}
114120
\input{libimageop}
121+
\input{libaifc}
115122
\input{libjpeg}
116123
\input{librgbimg}
117124

118-
\input{libcrypto} % CRYPTOGRAPHIC EXTENSIONS
125+
\input{libcrypto} % Cryptographic Services
119126
\input{libmd5}
120127
\input{libmpz}
121128
\input{librotor}

Doc/lib/lib.tex

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
\begin{abstract}
2323

2424
\noindent
25-
This document describes the built-in types, exceptions and functions
26-
and the standard modules that come with the Python system. It assumes
25+
This document describes the built-in and standard types, exceptions,
26+
functions and modules that come with the Python system. It assumes
2727
basic knowledge about the Python language. For an informal
2828
introduction to the language, see the {\em Python Tutorial}. The {\em
2929
Python Reference Manual} gives a more formal definition of the
@@ -51,52 +51,58 @@
5151
\input{libexcs}
5252
\input{libfuncs}
5353

54-
\input{libmods} % Built-in modules
54+
\input{libpython} % Python Services
5555
\input{libsys}
56-
\input{libbltin} % really __builtin__
56+
\input{libtypes2} % types is already taken :-(
57+
\input{libtraceback}
58+
\input{libpickle}
59+
\input{libshelve}
60+
\input{libcopy}
61+
\input{libmarshal}
5762
\input{libimp}
63+
\input{libbltin} % really __builtin__
5864
\input{libmain} % really __main__
59-
\input{libarray}
60-
\input{libmath}
61-
\input{libtime}
65+
66+
\input{libstrings} % String Services
67+
\input{libstring}
6268
\input{libregex}
63-
\input{libmarshal}
69+
\input{libregsub}
6470
\input{libstruct}
6571

66-
\input{libstd} % Standard Modules
67-
\input{libgetopt}
68-
\input{libos}
72+
\input{libmisc} % Miscellaneous Services
73+
\input{libmath}
6974
\input{librand}
70-
\input{libregsub}
71-
\input{libstring}
7275
\input{libwhrandom}
73-
\input{libaifc}
74-
\input{libpickle}
75-
\input{libshelve}
76-
\input{libcopy}
77-
\input{libtypes2} % types is already taken :-(
78-
\input{libtempfile}
79-
\input{libtraceback}
76+
\input{libarray}
8077

81-
\input{libpdb} % The Python Debugger
78+
\input{liballos} % Generic Operating System Services
79+
\input{libos}
80+
\input{libtime}
81+
\input{libgetopt}
82+
\input{libtempfile}
8283

83-
\input{libprofile} % The Python Profiler
84+
\input{libsomeos} % Optional Operating System Services
85+
\input{libsignal}
86+
\input{libsocket}
87+
\input{libselect}
88+
\input{libthread}
8489

85-
\input{libunix} % UNIX ONLY
90+
\input{libunix} % UNIX Specific Services
91+
\input{libposix}
92+
\input{libppath} % == posixpath
93+
\input{libpwd}
94+
\input{libgrp}
8695
\input{libdbm}
87-
\input{libfcntl}
8896
\input{libgdbm}
89-
\input{libgrp}
90-
\input{libposix}
97+
\input{libtermios}
98+
\input{libfcntl}
9199
\input{libposixfile}
92-
\input{libppath} % really posixpath
93-
\input{libpwd}
94-
\input{libselect}
95-
\input{libsignal}
96-
\input{libsocket}
97-
\input{libthread}
98100

99-
\input{libwww} % WWW EXTENSIONS
101+
\input{libpdb} % The Python Debugger
102+
103+
\input{libprofile} % The Python Profiler
104+
105+
\input{libwww} % Internet and WWW Services
100106
\input{libcgi}
101107
\input{liburllib}
102108
\input{libhttplib}
@@ -109,13 +115,14 @@
109115
\input{librfc822}
110116
\input{libmimetools}
111117

112-
\input{libmm} % MULTIMEDIA EXTENSIONS
118+
\input{libmm} % Multimedia Services
113119
\input{libaudioop}
114120
\input{libimageop}
121+
\input{libaifc}
115122
\input{libjpeg}
116123
\input{librgbimg}
117124

118-
\input{libcrypto} % CRYPTOGRAPHIC EXTENSIONS
125+
\input{libcrypto} % Cryptographic Services
119126
\input{libmd5}
120127
\input{libmpz}
121128
\input{librotor}

Doc/lib/libaifc.tex

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ \section{Standard Module \sectcode{aifc}}
1111
sound is sampled. The number of channels indicate if the audio is
1212
mono, stereo, or quadro. Each frame consists of one sample per
1313
channel. The sample size is the size in bytes of each sample. Thus a
14-
frame consists of \var{nchannels}*\var{framesize} bytes, and a second's worth of
15-
audio consists of \var{nchannels}*\var{framesize}*\var{framerate} bytes.
14+
frame consists of \var{nchannels}*\var{samplesize} bytes, and a
15+
second's worth of audio consists of
16+
\var{nchannels}*\var{samplesize}*\var{framerate} bytes.
17+
18+
For example, CD quality audio has a sample size of two bytes (16
19+
bits), uses two channels (stereo) and has a frame rate of 44,100
20+
frames/second. This gives a frame size of 4 bytes (2*2), and a
21+
second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
1622

1723
Module \code{aifc} defines the following function:
1824

@@ -148,7 +154,7 @@ \section{Standard Module \sectcode{aifc}}
148154
NONE, ULAW, ALAW, G722.
149155
\end{funcdesc}
150156

151-
\begin{funcdesc}{setparams}{(nchannels\, sampwidth\, framerate\, comptype\, compname)}
157+
\begin{funcdesc}{setparams}{nchannels\, sampwidth\, framerate\, comptype\, compname}
152158
Set all the above parameters at once. The argument is a tuple
153159
consisting of the various parameters. This means that it is possible
154160
to use the result of a \code{getparams} call as argument to

Doc/lib/liballos.tex

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
\chapter{Generic Operating System Services}
2+
3+
The modules described in this chapter provide interfaces to operating
4+
system features that are available on (almost) all operating systems,
5+
such as files and a clock. The interfaces are generally modelled
6+
after the \UNIX{} or C interfaces but they are available on most other
7+
systems as well. Here's an overview:
8+
9+
\begin{description}
10+
11+
\item[os]
12+
--- Miscellaneous OS interfaces.
13+
14+
\item[time]
15+
--- Time access and conversions.
16+
17+
\item[getopt]
18+
--- Parser for command line options.
19+
20+
\item[tempfile]
21+
--- Generate temporary file names.
22+
23+
\end{description}

Doc/lib/libamoeba.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\chapter{AMOEBA ONLY}
1+
\chapter{Amoeba Specific Services}
22

33
\section{Built-in Module \sectcode{amoeba}}
44

Doc/lib/libarray.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ \section{Built-in Module \sectcode{array}}
2323
architecture (strictly speaking, by the C implementation). The actual
2424
size can be accessed through the \var{itemsize} attribute.
2525

26+
See also built-in module \code{struct}.
27+
\bimodindex{struct}
28+
2629
The module defines the following function:
2730

2831
\renewcommand{\indexsubitem}{(in module array)}

Doc/lib/libcrypto.tex

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1-
\chapter{CRYPTOGRAPHIC EXTENSIONS}
1+
\chapter{Cryptographic Services}
2+
\index{cryptography}
23

34
The modules described in this chapter implement various algorithms of
45
a cryptographic nature. They are available at the discretion of the
5-
installation.
6-
\index{cryptography}
6+
installation. Here's an overview:
7+
8+
\begin{description}
9+
10+
\item[md5]
11+
--- RSA's MD5 message digest algorithm.
12+
13+
\item[mpz]
14+
--- Interface to the GNU MP library for arbitrary precision arithmetic.
15+
16+
\item[rotor]
17+
--- Enigma-like encryption and decryption.
18+
19+
\end{description}
720

821
Hardcore cypherpunks will probably find the Python Cryptography Kit of
922
further interest; the package adds built-in modules for DES and IDEA

Doc/lib/libfuncs.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ \section{Built-in Functions}
197197
Convert a number to a plain integer. The argument may be a plain or
198198
long integer or a floating point number. Conversion of floating
199199
point numbers to integers is defined by the C semantics; normally
200-
the conversion truncates towards zero.
200+
the conversion truncates towards zero.\footnote{This is ugly --- the
201+
language definition should require truncation towards zero.}
201202
\end{funcdesc}
202203

203204
\begin{funcdesc}{len}{s}

Doc/lib/libhttplib.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ \section{Standard Module \sectcode{httplib}}
4646

4747
\end{enumerate}
4848

49+
\subsection{HTTP Objects}
50+
4951
\code{HTTP} instances have the following methods:
5052

53+
\renewcommand{\indexsubitem}{(HTTP method)}
54+
5155
\begin{funcdesc}{set_debuglevel}{level}
5256
Set the debugging level (the amount of debugging output printed).
5357
The default debug level is \code{0}, meaning no debugging output is

0 commit comments

Comments
 (0)