-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Types for complex.__new__ should be any numeric type #8440
Copy link
Copy link
Closed
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors
Description
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.
Line 368 in f550c24
| def __new__(cls: type[Self], real: float = ..., imag: float = ...) -> Self: ... |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors