diff --git a/Lib/numbers.py b/Lib/numbers.py index 7eedc63ec0..0985dd85f6 100644 --- a/Lib/numbers.py +++ b/Lib/numbers.py @@ -33,9 +33,9 @@ class Complex(Number): """Complex defines the operations that work on the builtin complex type. In short, those are: a conversion to complex, .real, .imag, +, -, - *, /, abs(), .conjugate, ==, and !=. + *, /, **, abs(), .conjugate, ==, and !=. - If it is given heterogenous arguments, and doesn't have special + If it is given heterogeneous arguments, and doesn't have special knowledge about them, it should fall back to the builtin complex type as described below. """ @@ -288,11 +288,15 @@ class Rational(Real): so that ratios of huge integers convert without overflowing. """ - return self.numerator / self.denominator + return int(self.numerator) / int(self.denominator) class Integral(Rational): - """Integral adds a conversion to int and the bit-string operations.""" + """Integral adds methods that work on integral numbers. + + In short, these are conversion to int, pow with modulus, and the + bit-string operations. + """ __slots__ = () diff --git a/Lib/test/test_numeric_tower.py b/Lib/test/test_numeric_tower.py index 6441255ec1..9cd85e1363 100644 --- a/Lib/test/test_numeric_tower.py +++ b/Lib/test/test_numeric_tower.py @@ -134,8 +134,6 @@ class HashTest(unittest.TestCase): self.check_equal_hash(D('12300.00'), D(12300)) self.check_equal_hash(D('12300.000'), D(12300)) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_fractions(self): # check special case for fractions where either the numerator # or the denominator is a multiple of _PyHASH_MODULUS