Kaydet (Commit) 95817b36 authored tarafından Georg Brandl's avatar Georg Brandl

Remove mentions of "plain" integers.

üst 6e6dcb57
...@@ -157,9 +157,9 @@ The following exceptions are the exceptions that are actually raised. ...@@ -157,9 +157,9 @@ The following exceptions are the exceptions that are actually raised.
.. exception:: IndexError .. exception:: IndexError
Raised when a sequence subscript is out of range. (Slice indices are silently Raised when a sequence subscript is out of range. (Slice indices are
truncated to fall in the allowed range; if an index is not a plain integer, silently truncated to fall in the allowed range; if an index is not an
:exc:`TypeError` is raised.) integer, :exc:`TypeError` is raised.)
.. XXX xref to sequences .. XXX xref to sequences
...@@ -282,10 +282,10 @@ The following exceptions are the exceptions that are actually raised. ...@@ -282,10 +282,10 @@ The following exceptions are the exceptions that are actually raised.
This exception is raised by the :func:`sys.exit` function. When it is not This exception is raised by the :func:`sys.exit` function. When it is not
handled, the Python interpreter exits; no stack traceback is printed. If the handled, the Python interpreter exits; no stack traceback is printed. If the
associated value is a plain integer, it specifies the system exit status (passed associated value is an integer, it specifies the system exit status (passed
to C's :cfunc:`exit` function); if it is ``None``, the exit status is zero; if to C's :cfunc:`exit` function); if it is ``None``, the exit status is zero;
it has another type (such as a string), the object's value is printed and the if it has another type (such as a string), the object's value is printed and
exit status is one. the exit status is one.
Instances have an attribute :attr:`code` which is set to the proposed exit Instances have an attribute :attr:`code` which is set to the proposed exit
status or error message (defaulting to ``None``). Also, this exception derives status or error message (defaulting to ``None``). Also, this exception derives
......
...@@ -429,13 +429,13 @@ are always available. They are listed here in alphabetical order. ...@@ -429,13 +429,13 @@ are always available. They are listed here in alphabetical order.
.. function:: float([x]) .. function:: float([x])
Convert a string or a number to floating point. If the argument is a string, it Convert a string or a number to floating point. If the argument is a string,
must contain a possibly signed decimal or floating point number, possibly it must contain a possibly signed decimal or floating point number, possibly
embedded in whitespace. The argument may also be [+|-]nan or [+|-]inf. embedded in whitespace. The argument may also be ``'[+|-]nan'`` or
Otherwise, the argument may be a plain integer ``'[+|-]inf'``. Otherwise, the argument may be an integer or a floating
or a floating point number, and a floating point number with the same value point number, and a floating point number with the same value (within
(within Python's floating point precision) is returned. If no argument is Python's floating point precision) is returned. If no argument is given,
given, returns ``0.0``. ``0.0`` is returned.
.. note:: .. note::
...@@ -443,11 +443,12 @@ are always available. They are listed here in alphabetical order. ...@@ -443,11 +443,12 @@ are always available. They are listed here in alphabetical order.
single: NaN single: NaN
single: Infinity single: Infinity
When passing in a string, values for NaN and Infinity may be returned, depending When passing in a string, values for NaN and Infinity may be returned,
on the underlying C library. Float accepts the strings nan, inf and -inf for depending on the underlying C library. Float accepts the strings
NaN and positive or negative infinity. The case and a leading + are ignored as ``'nan'``, ``'inf'`` and ``'-inf'`` for NaN and positive or negative
well as a leading - is ignored for NaN. Float always represents NaN and infinity infinity. The case and a leading + are ignored as well as a leading - is
as nan, inf or -inf. ignored for NaN. Float always represents NaN and infinity as ``nan``,
``inf`` or ``-inf``.
The float type is described in :ref:`typesnumeric`. The float type is described in :ref:`typesnumeric`.
...@@ -873,15 +874,15 @@ are always available. They are listed here in alphabetical order. ...@@ -873,15 +874,15 @@ are always available. They are listed here in alphabetical order.
.. XXX does accept objects with __index__ too .. XXX does accept objects with __index__ too
.. function:: range([start,] stop[, step]) .. function:: range([start,] stop[, step])
This is a versatile function to create lists containing arithmetic progressions. This is a versatile function to create iterators yielding arithmetic
It is most often used in :keyword:`for` loops. The arguments must be plain progressions. It is most often used in :keyword:`for` loops. The arguments
integers. If the *step* argument is omitted, it defaults to ``1``. If the must be integers. If the *step* argument is omitted, it defaults to ``1``.
*start* argument is omitted, it defaults to ``0``. The full form returns a list If the *start* argument is omitted, it defaults to ``0``. The full form
of plain integers ``[start, start + step, start + 2 * step, ...]``. If *step* returns an iterator of integers ``[start, start + step, start + 2 * step,
is positive, the last element is the largest ``start + i * step`` less than ...]``. If *step* is positive, the last element is the largest ``start + i *
*stop*; if *step* is negative, the last element is the smallest ``start + i * step`` less than *stop*; if *step* is negative, the last element is the
step`` greater than *stop*. *step* must not be zero (or else :exc:`ValueError` smallest ``start + i * step`` greater than *stop*. *step* must not be zero
is raised). Example: (or else :exc:`ValueError` is raised). Example:
>>> list(range(10)) >>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
......
...@@ -598,7 +598,7 @@ The resulting profiler will then call :func:`your_time_func`. ...@@ -598,7 +598,7 @@ The resulting profiler will then call :func:`your_time_func`.
timer call, along with the appropriate calibration constant. timer call, along with the appropriate calibration constant.
:class:`cProfile.Profile` :class:`cProfile.Profile`
:func:`your_time_func` should return a single number. If it returns plain :func:`your_time_func` should return a single number. If it returns
integers, you can also invoke the class constructor with a second argument integers, you can also invoke the class constructor with a second argument
specifying the real duration of one unit of time. For example, if specifying the real duration of one unit of time. For example, if
:func:`your_integer_time_func` returns times measured in thousands of seconds, :func:`your_integer_time_func` returns times measured in thousands of seconds,
......
...@@ -218,7 +218,7 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex` ...@@ -218,7 +218,7 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex`
There are three distinct numeric types: :dfn:`integers`, :dfn:`floating point There are three distinct numeric types: :dfn:`integers`, :dfn:`floating point
numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of numbers`, and :dfn:`complex numbers`. In addition, Booleans are a subtype of
plain integers. Integers have unlimited precision. Floating point numbers are integers. Integers have unlimited precision. Floating point numbers are
implemented using :ctype:`double` in C. All bets on their precision are off implemented using :ctype:`double` in C. All bets on their precision are off
unless you happen to know the machine you are working with. unless you happen to know the machine you are working with.
......
...@@ -172,10 +172,7 @@ Ellipsis ...@@ -172,10 +172,7 @@ Ellipsis
There are two types of integers: There are two types of integers:
Plain integers Integers
.. index::
object: plain integer
single: OverflowError (built-in exception)
These represent numbers in an unlimited range, subject to available (virtual) These represent numbers in an unlimited range, subject to available (virtual)
memory only. For the purpose of shift and mask operations, a binary memory only. For the purpose of shift and mask operations, a binary
...@@ -191,7 +188,7 @@ Ellipsis ...@@ -191,7 +188,7 @@ Ellipsis
These represent the truth values False and True. The two objects representing These represent the truth values False and True. The two objects representing
the values False and True are the only Boolean objects. The Boolean type is a the values False and True are the only Boolean objects. The Boolean type is a
subtype of plain integers, and Boolean values behave like the values 0 and 1, subtype of the integer type, and Boolean values behave like the values 0 and 1,
respectively, in almost all contexts, the exception being that when converted to respectively, in almost all contexts, the exception being that when converted to
a string, the strings ``"False"`` or ``"True"`` are returned, respectively. a string, the strings ``"False"`` or ``"True"`` are returned, respectively.
......
...@@ -821,9 +821,9 @@ The unary ``+`` (plus) operator yields its numeric argument unchanged. ...@@ -821,9 +821,9 @@ The unary ``+`` (plus) operator yields its numeric argument unchanged.
.. index:: single: inversion .. index:: single: inversion
The unary ``~`` (invert) operator yields the bitwise inversion of its plain or The unary ``~`` (invert) operator yields the bitwise inversion of its integer
long integer argument. The bitwise inversion of ``x`` is defined as argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. It only
``-(x+1)``. It only applies to integral numbers. applies to integral numbers.
.. index:: exception: TypeError .. index:: exception: TypeError
......
...@@ -565,9 +565,9 @@ Numeric literals ...@@ -565,9 +565,9 @@ Numeric literals
floating point literal, hexadecimal literal floating point literal, hexadecimal literal
octal literal, binary literal, decimal literal, imaginary literal, complex literal octal literal, binary literal, decimal literal, imaginary literal, complex literal
There are three types of numeric literals: plain integers, floating point There are three types of numeric literals: integers, floating point numbers, and
numbers, and imaginary numbers. There are no complex literals imaginary numbers. There are no complex literals (complex numbers can be formed
(complex numbers can be formed by adding a real number and an imaginary number). by adding a real number and an imaginary number).
Note that numeric literals do not include a sign; a phrase like ``-1`` is Note that numeric literals do not include a sign; a phrase like ``-1`` is
actually an expression composed of the unary operator '``-``' and the literal actually an expression composed of the unary operator '``-``' and the literal
......
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