The types for the arguments to complex.__new__ should be any numeric type, not just float.
c1 = complex(1, 2)
c2 = complex(1, c1)
This code is valid, but the second line reports an error that complex is incompatible with float.
|
def __new__(cls: type[Self], real: float = ..., imag: float = ...) -> Self: ... |
The types for the arguments to
complex.__new__should be any numeric type, not just float.This code is valid, but the second line reports an error that complex is incompatible with float.
typeshed/stdlib/builtins.pyi
Line 368 in f550c24