Created
September 19, 2021 03:07
-
-
Save mypy-play/1cbdc48546f3a1bc61476936c3dc9af7 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Generic, TypeVar, Mapping | |
T = TypeVar("T") | |
T2 = TypeVar("T2") | |
class A(dict[T, T2]): | |
... | |
def foo(**i: float) -> None: | |
... | |
a: A[str, str] | |
d = {"a": "b"} | |
foo(**a) | |
foo(**d) # error: Argument 1 to "foo" has incompatible type "**Dict[str, str]"; expected "float" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment