-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
resort _ast and ast modules #11162
Merged
Merged
resort _ast and ast modules #11162
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The classes imported from the _ast module are defined in C, but set their __module__ to ast. This arrangement ensures that the type stubs have the same. related to python#3968 and the discussion in python#11141
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is heavily merge conflicted now and it's probably better to restart from scratch. I merged a few similar PRs recently and would be happy to review and merge this one if the conflicts are resolved. 3.8 is also now almost at EOL, so it's less important if we get the module wrong in 3.8. |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
This MR should be ready now as well. |
JelleZijlstra
approved these changes
Oct 5, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Well, I got a lukewarm to positive reaction from #11141, about what to do when c-implemented classes claim their module is the non-private one. So here's an MR to re-organize ast and _ast and get the type stubs to match what the implementation claims.
Mostly this is just lift and shift, but I took the opportunity to make the order within the file more closely match the implementation - that seems to be preferred?
related to #3968 and the discussion in #11141