@@ -49,30 +49,19 @@ The numeric tower
49
49
numbers.
50
50
51
51
In short, those are: a conversion to :class: `float `, :func: `math.trunc `,
52
- :func: `round `, :func: `math.floor `, :func: `math.ceil `, :func: `divmod `,
53
- :func: ` ~Real.is_integer `, `` // ``, ``% ``, ``< ``, ``<= ``, ``> ``, and ``>= ``.
52
+ :func: `round `, :func: `math.floor `, :func: `math.ceil `, :func: `divmod `, `` // ``,
53
+ ``% ``, ``< ``, ``<= ``, ``> ``, and ``>= ``.
54
54
55
55
Real also provides defaults for :func: `complex `, :attr: `~Complex.real `,
56
56
:attr: `~Complex.imag `, and :meth: `~Complex.conjugate `.
57
57
58
- .. method :: is_integer()
59
-
60
- Returns :const: `True ` if this number has a finite and integral value,
61
- otherwise :const: `False `. This is a default implementation which
62
- relies on successful conversion to :class: `int `. It may be overridden
63
- in subclasses (such as it is in :class: `float `) for better performance,
64
- or to handle special values such as NaN which are not
65
- convertible to :class: `int `.
66
-
67
- .. versionadded :: 3.10
68
-
69
58
70
59
.. class :: Rational
71
60
72
61
Subtypes :class: `Real ` and adds
73
62
:attr: `~Rational.numerator ` and :attr: `~Rational.denominator ` properties, which
74
- should be in lowest terms. With these, it provides defaults for
75
- :func: `float ` and :func: ` ~Real.is_integer ` .
63
+ should be in lowest terms. With these, it provides a default for
64
+ :func: `float `.
76
65
77
66
.. attribute :: numerator
78
67
@@ -86,10 +75,9 @@ The numeric tower
86
75
.. class :: Integral
87
76
88
77
Subtypes :class: `Rational ` and adds a conversion to :class: `int `. Provides
89
- defaults for :func: `float `, :attr: `~Rational.numerator `,
90
- :attr: `~Rational.denominator `, and :func: `~Real.is_integer `. Adds abstract
91
- methods for ``** `` and bit-string operations: ``<< ``, ``>> ``, ``& ``, ``^ ``,
92
- ``| ``, ``~ ``.
78
+ defaults for :func: `float `, :attr: `~Rational.numerator `, and
79
+ :attr: `~Rational.denominator `. Adds abstract methods for ``** `` and
80
+ bit-string operations: ``<< ``, ``>> ``, ``& ``, ``^ ``, ``| ``, ``~ ``.
93
81
94
82
95
83
Notes for type implementors
0 commit comments