-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-union-types
Description
def add_value(a: Union[float, int], b: Union[float, int]) -> Union[float, int]:
return a + b
Results in:
error: Unsupported operand types for + ("Union[float, int]" and "int")
Interestingly both
def add_value(a: Union[float, int], b: float) -> Union[float, int]:
return a + b
and
def add_value(a: int, b: Union[float, int]) -> Union[float, int]:
return a + b
work fine
thanatos, ostrokach, brycepg, rgkirch, nodakai and 5 more
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-union-types