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

Skip to content

Commit 43b5e40

Browse files
committed
* Fix markup.
* Fix entry order: - >>> before ... - __slots__ in the S section (like __future__ is in the F section) Need to test the repaired(?) link to Guido's webpage. Still needs to have the module reference links made relative to the module directory instead of the tut directory. That will require Fred's magic touch.
1 parent 36bd2a1 commit 43b5e40

1 file changed

Lines changed: 26 additions & 25 deletions

File tree

Doc/tut/glossary.tex

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,30 @@ \chapter{Glossary\label{glossary}}
55

66
\begin{description}
77

8-
\index{...}
9-
\item[\code{.\code{.}.}]
10-
The typical Python prompt of the interactive shell when entering code
11-
for an indented code block.
128

139
\index{>>>}
1410
\item[\code{>\code{>}>}]
1511
The typical Python prompt of the interactive shell. Often seen for
1612
code examples that can be tried right away in the interpreter.
1713

18-
\index{__slots__}
19-
\item[__slots__]
20-
A declaration inside a \emph{new-style class} that saves memory by
21-
pre-declaring space for instance attributes and eliminating instance
22-
dictionaries. Though popular, the technique is somewhat tricky to get
23-
right and is best reserved for rare cases where there are large
24-
numbers of instances in a memory critical application.
14+
\index{...}
15+
\item[\code{.\code{.}.}]
16+
The typical Python prompt of the interactive shell when entering code
17+
for an indented code block.
2518

2619
\index{BDFL}
2720
\item[BDFL]
2821
Benevolent Dictator For Life, a.k.a. \ulink{Guido van
29-
Rossum}{http://www.python.org/~guido/}, Python's creator.
22+
Rossum}{http://www.python.org/\textasciitilde{}guido/}, Python's creator.
3023

3124
\index{byte code}
3225
\item[byte code]
3326
The internal representation of a Python program in the interpreter.
3427
The byte code is also cached in the \code{.pyc} and \code{.pyo}
3528
files so that executing the same file is faster the second time
3629
(compilation from source to byte code can be saved). This
37-
\emph{intermediate language} is said to run on a \emph{virtual
38-
machine} that calls the subroutines corresponding to each bytecode.
30+
``intermediate language'' is said to run on a ``virtual
31+
machine'' that calls the subroutines corresponding to each bytecode.
3932

4033
\index{classic class}
4134
\item[classic class]
@@ -47,8 +40,8 @@ \chapter{Glossary\label{glossary}}
4740
Converting data from one type to another. For example,
4841
{}\code{int(3.15)} coerces the floating point number to the integer,
4942
{}\code{3}. Most mathematical operations have rules for coercing
50-
their arguments to a common type. For instance, adding \code{3 +
51-
4.5}, causes the integer \code{3} to be coerced to be a float
43+
their arguments to a common type. For instance, adding \code{3+4.5},
44+
causes the integer \code{3} to be coerced to be a float
5245
{}\code{3.0} before adding to \code{4.5} resulting in the float
5346
{}\code{7.5}.
5447

@@ -85,15 +78,15 @@ \chapter{Glossary\label{glossary}}
8578
\item[__future__]
8679
A pseudo module which programmers can use to enable new language
8780
features which are not compatible with the current interpreter. For
88-
example, the expression \code{11 / 4} currently evaluates to \code{2}.
89-
If the module in which it is executed had enabled emph{true division}
81+
example, the expression \code{11/4} currently evaluates to \code{2}.
82+
If the module in which it is executed had enabled \emph{true division}
9083
by executing:
9184

9285
\begin{verbatim}
9386
from __future__ import division
9487
\end{verbatim}
9588

96-
the expression \code{11 / 4} would evaluate to \code{2.75}. By
89+
the expression \code{11/4} would evaluate to \code{2.75}. By
9790
actually importing the \refmodule[future]{__future__} module and
9891
evaluating its variables, you can see when a new feature was first
9992
added to the language and when it will become the default:
@@ -127,7 +120,7 @@ \chapter{Glossary\label{glossary}}
127120
entire interpreter makes it easier for the interpreter to be
128121
multi-threaded, at the expense of some parallelism on multi-processor
129122
machines. Efforts have been made in the past to create a
130-
"free-threaded" interpreter (one which locks shared data at a much
123+
``free-threaded'' interpreter (one which locks shared data at a much
131124
finer granularity), but performance suffered in the common
132125
single-processor case.
133126

@@ -150,7 +143,7 @@ \chapter{Glossary\label{glossary}}
150143
\index{integer division}
151144
\item[integer division]
152145
Mathematical division discarding any remainder. For example, the
153-
expression \code{11 / 4} currently evaluates to \code{2} in contrast
146+
expression \code{11/4} currently evaluates to \code{2} in contrast
154147
to the \code{2.75} returned by float division. Also called
155148
{}\emph{floor division}. When dividing two integers the outcome will
156149
always be another integer (having the floor function applied to it).
@@ -180,7 +173,7 @@ \chapter{Glossary\label{glossary}}
180173
\index{iterable}
181174
\item[iterable]
182175
A container object capable of returning its members one at a time.
183-
Examples of iterables include all sequence types (such as\class{list},
176+
Examples of iterables include all sequence types (such as \class{list},
184177
{}\class{str}, and \class{tuple}) and some non-sequence types like
185178
{}\class{dict} and \class{file} and objects of any classes you define
186179
with an \method{__iter__()} or \method{__getitem__()} method. Iterables
@@ -190,7 +183,7 @@ \chapter{Glossary\label{glossary}}
190183
{}\function{iter()}, it returns an iterator for the object. This
191184
iterator is good for one pass over the set of values. When using
192185
iterables, it is usually not necessary to call \function{iter()} or
193-
deal with iterator objects yourself---the \code{for} statement does
186+
deal with iterator objects yourself. The \code{for} statement does
194187
that automatically for you, creating a temporary unnamed variable to
195188
hold the iterator for the duration of the loop. See also
196189
{}\emph{iterator}, \emph{sequence}, and \emph{generator}.
@@ -281,14 +274,22 @@ \chapter{Glossary\label{glossary}}
281274
Any class that inherits from \class{object}. This includes all
282275
built-in types like \class{list} and \class{dict}. Only new-style
283276
classes can use Python's newer, versatile features like
284-
{}\var{__slots__}, descriptors, properties,
277+
{}\method{__slots__}, descriptors, properties,
285278
\method{__getattribute__()}, class methods, and static methods.
286279

287280
\index{Python3000}
288281
\item[Python3000]
289282
A mythical python release, allowed not to be backward compatible, with
290283
telepathic interface.
291284

285+
\index{__slots__}
286+
\item[__slots__]
287+
A declaration inside a \emph{new-style class} that saves memory by
288+
pre-declaring space for instance attributes and eliminating instance
289+
dictionaries. Though popular, the technique is somewhat tricky to get
290+
right and is best reserved for rare cases where there are large
291+
numbers of instances in a memory critical application.
292+
292293
\index{sequence}
293294
\item[sequence]
294295
An \emph{iterable} which supports efficient element access using
@@ -304,6 +305,6 @@ \chapter{Glossary\label{glossary}}
304305
\item[Zen of Python]
305306
Listing of Python design principles and philosophies that are helpful
306307
in understanding and using the language. The listing can be found by
307-
typing \code{import this} at the interactive prompt.
308+
typing ``\code{import this}'' at the interactive prompt.
308309

309310
\end{description}

0 commit comments

Comments
 (0)