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
I'd expect a call to TypedDict to be allowed to be used as a base class:
classParams(
TypedDict( # This should work"Params",
{"is": NotRequired["str"]},
),
):
passa: Params= { "is": "a" } # Produces misleading error
Actual Behavior
Instead, it produces the following errors:
main.py:4: error: Unsupported dynamic base class "TypedDict" [misc]
main.py:11: error: Incompatible types in assignment (expression has type "dict[str, str]", variable has type "Params") [assignment]
Your Environment
Mypy version used: 1.7.1
Mypy command-line flags: N/A
Mypy configuration options from mypy.ini (and other config files): N/A
Python version used: 3.12
The text was updated successfully, but these errors were encountered:
Bug Report
Using
TypedDict
's alternative functional syntax as a base class produces aUnsupported dynamic base class "TypedDict" [misc]
error.To Reproduce
Gist: https://mypy-play.net/?mypy=latest&python=3.12&gist=78872722658fe7bd5042cba6318b0432
Expected Behavior
I'd expect a call to
TypedDict
to be allowed to be used as a base class:Actual Behavior
Instead, it produces the following errors:
Your Environment
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: