Closed
Description
from mypy_extensions import TypedDict
FooDict = TypedDict(
'FooDict',
{
'foo': str,
},
)
def my_cool_function(arg: FooDict) -> None:
pass
my_cool_function({"foo": "bar"})
my_cool_function({str("foo"): "bar"})
$ mypy blurp.py
blurp.py:17: error: Expected TypedDict key to be string literal
I understand this is going through the str()
function, which is why it's failing, but it seems like this simple case could be handled.
Metadata
Metadata
Assignees
Labels
No labels