Commit e701dcba authored by Raymond Hettinger's avatar Raymond Hettinger

SF patch #634866: Alex Martelli's corrections to the ref manual.

Backport candidate.  All but one or two of these changes
are applicable to 2.2.2.
parent 4bad9ba2
......@@ -326,7 +326,9 @@ meanings. These are:
\lineiii{__*}{Class-private name mangling}{}
\end{tableiii}
(XXX need section references here.)
See sections: \ref{import}, ``The \keyword{import} statement'';
\ref{specialnames}, ``Special method names'';
\ref{atom-identifiers}, ``Identifiers (Names)''.
Note:
......@@ -562,18 +564,25 @@ allowed as suffix for long integers, it is strongly recommended to always
use \character{L}, since the letter \character{l} looks too much like the
digit \character{1}.
Plain integer decimal literals must be at most 2147483647 (i.e., the
largest positive integer, using 32-bit arithmetic). Plain octal and
hexadecimal literals may be as large as 4294967295, but values larger
than 2147483647 are converted to a negative value by subtracting
4294967296. There is no limit for long integer literals apart from
what can be stored in available memory.
Some examples of plain and long integer literals:
Plain integer decimal literals that are above the largest representable
plain integer (e.g., 2147483647 when using 32-bit arithmetic) are accepted
as if they were long integers instead. Octal and hexadecimal literals
behave similarly, but when in the range just above the largest representable
plain integer but below the largest unsigned 32-bit number (on a machine
using 32-bit arithmetic), 4294967296, they are taken as the negative plain
integer obtained by subtracting 4294967296 from their unsigned value. There
is no limit for long integer literals apart from what can be stored in
available memory. For example, 0xdeadbeef is taken, on a 32-bit machine,
as the value -559038737, while 0xdeadbeeffeed is taken as the value
244837814107885L.
Some examples of plain integer literals (first row) and long integer
literals (second and third rows):
\begin{verbatim}
7 2147483647 0177 0x80000000
3L 79228162514264337593543950336L 0377L 0x100000000L
79228162514264337593543950336 0xdeadbeeffeed
\end{verbatim}
......
This diff is collapsed.
......@@ -638,9 +638,15 @@ identifier in the list. The form with \keyword{from} performs step
\indexii{importing}{module}
\indexii{name}{binding}
\kwindex{from}
% XXX Need to define what ``initialize'' means here
The system maintains a table of modules that have been initialized,
In this context, to ``initialize'' a built-in or extension module means to
call an initialization function that the module must provide for the purpose
(in the reference implementation, the function's name is obtained by
prepending string ``init'' to the module's name); to ``initialize'' a
Python-coded module means to execute the module's body.
The system maintains a table of modules that have been or are being
initialized,
indexed by module name. This table is
accessible as \code{sys.modules}. When a module name is found in
this table, step (1) is finished. If not, a search for a module
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment