diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2020-10-06 22:13:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 22:13:34 -0700 |
commit | 1cc1a8f11a769c42a162229f3e1fb3a0fa74d4b9 (patch) | |
tree | e739e0905d3b06a1ebbbfca18fbf324989b99ad4 /Doc/library/numbers.rst | |
parent | 044a1048ca93d466965afc027b91a5a9eb9ce23c (diff) | |
download | cpython-git-revert-6121-is_integer.tar.gz |
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)"revert-6121-is_integer
This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.
Diffstat (limited to 'Doc/library/numbers.rst')
-rw-r--r-- | Doc/library/numbers.rst | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst index 5d49f5eb96..1b594952ea 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 |