-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-44635: Convert None to NoneType in the union type constructor #27136
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
bpo-44635: Convert None to NoneType in the union type constructor #27136
Conversation
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.
LGTM.
self.assertEqual((int | (str | list)).__args__, (int, str, list)) | ||
self.assertEqual((int | None).__args__, (int, type(None))) | ||
self.assertEqual((int | type(None)).__args__, (int, type(None))) | ||
|
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.
I recommend one more simple test to test equality of two unions.
self.assertEqual(int | type(None), int | None) | |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry @serhiy-storchaka, I had trouble checking out the |
GH-27141 is a backport of this pull request to the 3.10 branch. |
…tor (pythonGH-27136). (cherry picked from commit b81cac0) Co-authored-by: Serhiy Storchaka <[email protected]>
https://bugs.python.org/issue44635