8000 Update `types.SimpleNamespace` for 3.13 by max-muoto · Pull Request #12297 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 5 commits into from
Jul 9, 2024
Merged

Conversation

max-muoto
Copy link
Contributor
@max-muoto max-muoto commented Jul 9, 2024

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.

@max-muoto max-muoto changed the title Simplenamespace Update types.Simplenamespace for 3.13` Jul 9, 2024
@max-muoto max-muoto changed the title Update types.Simplenamespace for 3.13` Update types.Simplenamespace for 3.13 Jul 9, 2024
@max-muoto max-muoto marked this pull request as ready for review July 9, 2024 02:25
@max-muoto max-muoto changed the title Update types.Simplenamespace for 3.13 Update `types.Simplenamespace for 3.13 Jul 9, 2024
@max-muoto max-muoto changed the title Update `types.Simplenamespace for 3.13 Update types.Simplenamespace for 3.13 Jul 9, 2024
@max-muoto max-muoto changed the title Update types.Simplenamespace for 3.13 Update types.SimpleNamespace for 3.13 Jul 9, 2024
@max-muoto max-muoto marked this pull request as draft July 9, 2024 02:29
@max-muoto max-muoto marked this pull request as ready for review July 9, 2024 02:31

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
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor
github-actions bot commented Jul 9, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 23fd30f into python:main Jul 9, 2024
63 checks passed
max-muoto added a commit to max-muoto/typeshed that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0