You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected Behavior
The code should raise a typing error similar to what pyright reports
mypy_typeddict.py:9:12 - error: Could not access item in TypedDict
"foo" is not a required key in "Data", so access may result in runtime exception (reportTypedDictNotRequiredAccess)
1 error, 0 warnings, 0 informations
This is important because the code above does produce a runtime error. Actual Behavior
No error is reported
Your Environment
Mypy version used: 1.15.0
Mypy command-line flags: --strict
Mypy configuration options from mypy.ini (and other config files):
Python version used: 3.12
The text was updated successfully, but these errors were encountered:
Bug Report
Optional fields in TypeDicts are not reported, allowing to unsafely access such fields.
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.12&flags=strict&gist=aa7bfac9b1c70873510bb3e28128f1d4
Expected Behavior
The code should raise a typing error similar to what pyright reports
This is important because the code above does produce a runtime error.
Actual Behavior
No error is reported
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: