mypy
does not infer that a string Literal
is a str
in the context of a dict
or Mapping
#18494
Labels
bug
mypy got something wrong
Bug Report
Mypy reports an
arg-type
error when passing a dictionary withLiteral
keys to a function typed to receive a dictionary withstr
keys, even when all such literals are strings.To Reproduce
Expected Behavior
Since the literal "key" is a string, I expected mypy to report no error here.
Actual Behavior
Mypy reported the
arg-type
errors described in the above reprex.Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: