-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-type-variablestopic-union-types
Description
from typing import *
U = Union[int, str]
d: Dict[Type[U], int] = {int: 1, str: 2}
T = TypeVar('T', bound=U)
def get(t: Type[T]) -> int:
return d[t]
foo.py:6: error: Invalid index type Type[T] for Dict[Union[Type[int], Type[str]], int]; expected type "Union[Type[int], Type[str]]"
Using mypy 0.521
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-type-variablestopic-union-types