Repository navigation
resort _ast and ast modules - #11162
Merged
Merged
Conversation
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
tungol
marked this pull request as draft
December 14, 2023 02:47
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.
tungol
marked this pull request as ready for review
December 14, 2023 03:20
tungol
marked this pull request as draft
December 16, 2023 23:27
Member
|
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. |
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
tungol
marked this pull request as ready for review
October 4, 2024 20:02
Contributor
Author
|
This MR should be ready now as well. |
JelleZijlstra
self-requested a review
October 4, 2024 20:53
JelleZijlstra
approved these changes
Oct 5, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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