-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-44731: Simplify the union type implementation #27318
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
Remove direct support of typing types in the C code because they are already supported by defining methods __or__ and __ror__ in the Python code.
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.
Thanks, LGTM. Are we backporting this to 3.10? If we don't then 3.10 -> 3.11 runtime may have a breaking change (returning typing.Union over types.Union for some types).
It is not necessary to backport it to 3.10 because it does not fix bugs. But it makes the code much simpler and more reliable (the removed code uses tricks and was rewritten many times), and it is better to make potentially incompatible changes while there are not many users of this class. But it is all up to the release manager. @pablogsal |
Thanks for checking @serhiy-storchaka ! I reviewed the code and I am comfortable backporting it as the union type is a new feature and this is not a lot of code and will help maintaining it and future backports. But please, land it as soon as possible so people they test main can test it a bit before the RC 1. |
Thanks @serhiy-storchaka for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, @serhiy-storchaka and @pablogsal, I could not cleanly backport this to |
@serhiy-storchaka Can you do the backport? |
@pablogsal I'm currently doing the backport, but 3.11 and 3.10 are quite out of sync because GH-27244 wasn't backported. |
@Fidget-Spinner You can try the backport now :) |
Thanks @serhiy-storchaka for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry @serhiy-storchaka and @pablogsal, I had trouble checking out the |
Well I tried... time to do it manually. |
Remove direct support of typing types in the C code because they are already supported by defining methods __or__ and __ror__ in the Python code.
GH-27334 is a backport of this pull request to the 3.10 branch. |
Thank you for backporting @Fidget-Spinner. |
Remove direct support of typing types in the C code because they
are already supported by defining methods or and ror in
the Python code.
https://bugs.python.org/issue44731