TypedDict
errors on use of merge operator |=
even if keys are correct
#16244
Labels
TypedDict
errors on use of merge operator |=
even if keys are correct
#16244
Bug Report
For
TypedDict
, mypy accepts the use of.update()
using adict
with appropriate keys. However, using the merge operator|=
forTypedDict
gives an error.To Reproduce
mypy Playground
Expected Behavior
Using merge operator
|=
onTypedDict
should be allowed, since.update()
is supported.Actual Behavior
Errors when using
|=
onTypedDict
, even though the given keys are appropriate. This effectively means that projects using mypy cannot use PEP 584 syntax.The text was updated successfully, but these errors were encountered: