Open
Description
The signature of Rational.__truediv__
is marked as the following:
First of, _ComplexLike
sounds like it should be numbers.Complex
. But second, the signature should be more refined :
- the divisor cannot be just any value, it has to be a number, so at a minimum
numbers.Complex
instead of Unknown. The typing signature should be(self, Complex) -> Complex
. - when passing a Real as a divisor, the result cannot have an imaginary part and must be Real too. I'd go as far as saying that a Rational divisor would yield a Rational dividend. In any case, a
(self, Real) -> Real
overload should be defined. And as a bonus, a(self, Rational) -> Rational
one too.