summaryrefslogtreecommitdiffstats
path: root/Doc/library/numbers.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2020-10-07 23:43:44 (GMT)
committerGitHub <noreply@github.com>2020-10-07 23:43:44 (GMT)
commit4e0ce820586e93cfcefb16c2a3df8eaefc54cbca (patch)
tree62e95d644abcbc04dd6baedc9b3f44f42d4d974f /Doc/library/numbers.rst
parent4f3c25043d651a13c41cffcee703f7d5cb677cc7 (diff)
downloadcpython-4e0ce820586e93cfcefb16c2a3df8eaefc54cbca.zip
cpython-4e0ce820586e93cfcefb16c2a3df8eaefc54cbca.tar.gz
cpython-4e0ce820586e93cfcefb16c2a3df8eaefc54cbca.tar.bz2
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)" (GH-22584)
This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.
Diffstat (limited to 'Doc/library/numbers.rst')
-rw-r--r--Doc/library/numbers.rst26
1 files changed, 7 insertions, 19 deletions
diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst
index 5d49f5e..1b59495 100644
--- a/Doc/library/numbers.rst
+++ b/Doc/library/numbers.rst
@@ -49,30 +49,19 @@ The numeric tower
numbers.
In short, those are: a conversion to :class:`float`, :func:`math.trunc`,
- :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`,
- :func:`~Real.is_integer`, ``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``.
+ :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``,
+ ``%``, ``<``, ``<=``, ``>``, and ``>=``.
Real also provides defaults for :func:`complex`, :attr:`~Complex.real`,
:attr:`~Complex.imag`, and :meth:`~Complex.conjugate`.
- .. method:: is_integer()
-
- Returns :const:`True` if this number has a finite and integral value,
- otherwise :const:`False`. This is a default implementation which
- relies on successful conversion to :class:`int`. It may be overridden
- in subclasses (such as it is in :class:`float`) for better performance,
- or to handle special values such as NaN which are not
- convertible to :class:`int`.
-
- .. versionadded:: 3.10
-
.. class:: Rational
Subtypes :class:`Real` and adds
:attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which
- should be in lowest terms. With these, it provides defaults for
- :func:`float` and :func:`~Real.is_integer`.
+ should be in lowest terms. With these, it provides a default for
+ :func:`float`.
.. attribute:: numerator
@@ -86,10 +75,9 @@ The numeric tower
.. class:: Integral
Subtypes :class:`Rational` and adds a conversion to :class:`int`. Provides
- defaults for :func:`float`, :attr:`~Rational.numerator`,
- :attr:`~Rational.denominator`, and :func:`~Real.is_integer`. Adds abstract
- methods for ``**`` and bit-string operations: ``<<``, ``>>``, ``&``, ``^``,
- ``|``, ``~``.
+ defaults for :func:`float`, :attr:`~Rational.numerator`, and
+ :attr:`~Rational.denominator`. Adds abstract methods for ``**`` and
+ bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``.
Notes for type implementors