Bug Report
When pulling the example of Generics from the documentation and specifying a generic TypedDict following the blog post, I get an error on simple Generic example.
To Reproduce
fromtypingimportGeneric, TypeVarfromtyping_extensionsimportTypedDict# I am using python 3.10.4T=TypeVar("T")
MyDict=TypedDict("MyDict", {"foo": T})
classStack(Generic[T]): # mypy error: Free type variable expected in Generic[...] [misc]def__init__(self) ->None:
passCommenting line 5 removes the error. Moving line 5 after the declaration of Stack also works.
Expected Behavior
That class Stack is a correct Generic and mypy should not error.
Your Environment
- Mypy version used: 0.981
- Python version used: 3.10.4
Bug Report
When pulling the example of Generics from the documentation and specifying a generic TypedDict following the blog post, I get an error on simple Generic example.
To Reproduce
Commenting line 5 removes the error. Moving line 5 after the declaration of
Stackalso works.Expected Behavior
That class Stack is a correct Generic and mypy should not error.
Your Environment