-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
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
MyPy seems to be unaware of the length of a Tuple
when wrapped in a Union
:
from typing import Union, Tuple
def get_tuple() -> Union[Tuple[int, int], Tuple[None, None]]:
return (1, 2)
def process_tuple(one, two, flag=False):
print(one, two, flag)
process_tuple(*get_tuple(), flag=True)
1.py:12: error: "process_tuple" gets multiple values for keyword argument "flag"
Same code without a unionized type (def get_tuple() -> Tuple[int, int]:
) works.
sirkonst, t-mart, mariushelf, m-aciek, jamesbraza and 28 moredashed, kiel-nokia and tushar5526
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