-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
resort _ast and ast modules #11162
resort _ast and ast modules #11162
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
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. |
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