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
{{ message }}
Repository navigation
Optional fields in TypedDicts are not reported #18879
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):
Activity
brianschubert commentedon Apr 4, 2025
Thanks - closing as duplicate of #12094