-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix base class compatibility for IntFlag in Python 3.11+ to resolve inverted type issue #13854
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
base: main
Are you sure you want to change the base?
Conversation
…nverted type issue
This comment has been minimized.
This comment has been minimized.
stdlib/enum.pyi
Outdated
@@ -299,6 +299,7 @@ if sys.version_info >= (3, 11): | |||
def __or__(self, other: int) -> Self: ... | |||
def __and__(self, other: int) -> Self: ... | |||
def __xor__(self, other: int) -> Self: ... | |||
def __invert__(self) -> IntFlag: ... |
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.
def __invert__(self) -> IntFlag: ... | |
def __invert__(self) -> Self: ... |
stdlib/enum.pyi
Outdated
@@ -309,6 +310,7 @@ else: | |||
def __or__(self, other: int) -> Self: ... | |||
def __and__(self, other: int) -> Self: ... | |||
def __xor__(self, other: int) -> Self: ... | |||
def __invert__(self) -> IntFlag: ... |
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.
def __invert__(self) -> IntFlag: ... | |
def __invert__(self) -> Self: ... |
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 for the suggestion! @brianschubert I've made the changes you recommended.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Fixes #13853