-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update types.SimpleNamespace
for 3.13
#12297
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
Conversation
types.Simplenamespace
for 3.13`types.Simplenamespace
for 3.13
types.Simplenamespace
for 3.13types.Simplenamespace
for 3.13
8067865
to
303e54b
Compare
types.Simplenamespace
for 3.13types.SimpleNamespace
for 3.13
dfbf2bf
to
a27ba0c
Compare
03de97e
to
e3cf76c
Compare
This comment has been minimized.
This comment has been minimized.
@@ -66,6 +66,7 @@ tkinter.tix.ScrolledWindow | |||
tkinter.tix.Shell | |||
types.GenericAlias.__getattr__ | |||
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 | |||
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the "Allowlist entries that cannot or should not be fixed" section here as well as the other allowlists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
See here for the cpython change.
types.SimpleNamespace
now can take in an iterable of pairs or dictionary when initializing.Note: These stubs are slightly stricter than what's actually allowed at runtime. To help reduce the chance of runtime errors I think it makes sense to simply limit pairs to tuples, but happy to walk back this decision.