Open
Description
Feature
After PEP 655 was implemented, mypy now checks initialization of typed dicts. Access to these dicts however is not checked for required/optional.
Pitch
We have lots of code which makes use of TypedDict with optional parameters, and one of the most common coding errors is to call dict_value["param"]. Because these are not required keys, a sound type checker should disallow this access and instead require dict_value.get("param").
This problem was mentioned near the end of #2632 but no subsequent ticket was filed.
I intend to have a PR for this up in the next few minutes.