Accessing a NotRequired
field in a TypedDict
does not error
#17329
Labels
NotRequired
field in a TypedDict
does not error
#17329
Bug Report
Accessing a
NotRequired
field in aTypedDict
does not result in an error.To Reproduce
Expected Behavior
The final line should produce an error, either that
"Field"
is not necessarily defined or that the resulting access might produce a None, and thatval
is therefore the wrong type.Actual Behavior
No error.
Your Environment
MacOS Sonoma, arm64.
mypy.ini
(and other config files): defaultThe text was updated successfully, but these errors were encountered: