Description
Please provide more information to help us understand the issue:
-
Are you reporting a bug, or opening a feature request?
Bug -
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
from mypy_extensions import TypedDict
from typing_extensions import Literal
class Test(TypedDict):
a: str
b: str
TestKey = Literal['a', 'b']
def read(test: Test, key: TestKey):
return test[key]
-
What is the actual behavior/output?
mypy.py:13: error: TypedDict key must be a string literal; expected one of ('a', 'b') -
What is the behavior/output you expect?
No type check errors -
What are the versions of mypy and Python you are using?
mypy -- 0.660
python -- 3.6.3Do you see the same issue after installing mypy from Git master?
Yes -
What are the mypy flags you are using? (For example --strict-optional)
None -
If mypy crashed with a traceback, please paste
the full traceback below.
(You can freely edit this text, please remove all the lines
you believe are unnecessary.)