summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/exceptions.rst14
-rw-r--r--Doc/library/functions.rst43
-rw-r--r--Doc/library/profile.rst2
-rw-r--r--Doc/library/stdtypes.rst2
4 files changed, 31 insertions, 30 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 9c2e3a6..7129df5 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -157,9 +157,9 @@ The following exceptions are the exceptions that are actually raised.
.. exception:: IndexError
- Raised when a sequence subscript is out of range. (Slice indices are silently
- truncated to fall in the allowed range; if an index is not a plain integer,
- :exc:`TypeError` is raised.)
+ Raised when a sequence subscript is out of range. (Slice indices are
+ silently truncated to fall in the allowed range; if an index is not an
+ integer, :exc:`TypeError` is raised.)
.. XXX xref to sequences
@@ -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
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
- to C's :cfunc:`exit` function); if it is ``None``, the exit status is zero; if
- it has another type (such as a string), the object's value is printed and the
- exit status is one.
+ 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 it has another type (such as a string), the object's value is printed and
+ the exit status is one.
Instances have an attribute :attr:`code` which is set to the proposed exit
status or error message (defaulting to ``None``). Also, this exception derives
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index ff6069d..4689985 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -429,13 +429,13 @@ are always available. They are listed here in alphabetical order.
.. function:: float([x])
- Convert a string or a number to floating point. If the argument is a string, it
- must contain a possibly signed decimal or floating point number, possibly
- embedded in whitespace. The argument may also be [+|-]nan or [+|-]inf.
- Otherwise, the argument may be a plain integer
- or a floating point number, and a floating point number with the same value
- (within Python's floating point precision) is returned. If no argument is
- given, returns ``0.0``.
+ Convert a string or a number to floating point. If the argument is a string,
+ it must contain a possibly signed decimal or floating point number, possibly
+ embedded in whitespace. The argument may also be ``'[+|-]nan'`` or
+ ``'[+|-]inf'``. Otherwise, the argument may be an integer or a floating
+ point number, and a floating point number with the same value (within
+ Python's floating point precision) is returned. If no argument is given,
+ ``0.0`` is returned.
.. note::
@@ -443,11 +443,12 @@ are always available. They are listed here in alphabetical order.
single: NaN
single: Infinity
- When passing in a string, values for NaN and Infinity may be returned, depending
- on the underlying C library. Float accepts the strings nan, inf and -inf for
- NaN and positive or negative infinity. The case and a leading + are ignored as
- well as a leading - is ignored for NaN. Float always represents NaN and infinity
- as nan, inf or -inf.
+ When passing in a string, values for NaN and Infinity may be returned,
+ depending on the underlying C library. Float accepts the strings
+ ``'nan'``, ``'inf'`` and ``'-inf'`` for NaN and positive or negative
+ infinity. The case and a leading + are ignored as well as a leading - is
+ ignored for NaN. Float always represents NaN and infinity as ``nan``,
+ ``inf`` or ``-inf``.
The float type is described in :ref:`typesnumeric`.
@@ -873,15 +874,15 @@ are always available. They are listed here in alphabetical order.
.. XXX does accept objects with __index__ too
.. function:: range([start,] stop[, step])
- This is a versatile function to create lists containing arithmetic progressions.
- It is most often used in :keyword:`for` loops. The arguments must be plain
- integers. If the *step* argument is omitted, it defaults to ``1``. If the
- *start* argument is omitted, it defaults to ``0``. The full form returns a list
- of plain integers ``[start, start + step, start + 2 * step, ...]``. If *step*
- is positive, the last element is the largest ``start + i * step`` less than
- *stop*; if *step* is negative, the last element is the smallest ``start + i *
- step`` greater than *stop*. *step* must not be zero (or else :exc:`ValueError`
- is raised). Example:
+ This is a versatile function to create iterators yielding arithmetic
+ progressions. It is most often used in :keyword:`for` loops. The arguments
+ must be integers. If the *step* argument is omitted, it defaults to ``1``.
+ If the *start* argument is omitted, it defaults to ``0``. The full form
+ returns an iterator of integers ``[start, start + step, start + 2 * step,
+ ...]``. If *step* is positive, the last element is the largest ``start + i *
+ step`` less than *stop*; if *step* is negative, the last element is the
+ smallest ``start + i * step`` greater than *stop*. *step* must not be zero
+ (or else :exc:`ValueError` is raised). Example:
>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
index c5c69a4..5f770f6 100644
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -598,7 +598,7 @@ The resulting profiler will then call :func:`your_time_func`.
timer call, along with the appropriate calibration constant.
: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
specifying the real duration of one unit of time. For example, if
:func:`your_integer_time_func` returns times measured in thousands of seconds,
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index c97e9ae..4259187 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -218,7 +218,7 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex`
There are three distinct numeric types: :dfn:`integers`, :dfn:`floating point
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
unless you happen to know the machine you are working with.