-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
TypedDict with total=False does not allow clear #12732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This behaviour is correct. According to https://peps.python.org/pep-0589/
|
If somebody still really wants to allow this, the best bet would be to define a specific error code for these errors which could be disabled globally (I'm not promising that we'd accept a PR, but we might). |
That's a good point lol, #14914 |
A great point, supporting |
Bug Report
I made a TypedDict with
total=False
. Then I wanted to clear it, but I got an [attr-defined] error. I can do pop, so I would expect to be able to do clear as well.To Reproduce
Actual Behavior
I got
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: