-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Adds StrEnum
support for python3.11
#12035
Conversation
test-data/unit/lib-stub/enum.pyi
Outdated
|
||
# It is python-3.11+ only: | ||
class StrEnum(str, Enum): | ||
def __new__(cls: Type[_T], value: int | _T) -> _T: ... |
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.
Over at typeshed I corrected this to
def __new__(cls: Type[_T], value: str | _T) -> _T: ...
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.
Yes, sure. This is a typo. Thanks!
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.
No problem — thanks for working on the PR! 😀
Did we turn off 3.11 CI completely? I don't see it in the list. |
Yeah we just turned if off. #12003 (comment) |
Since there are already a couple of alpha versions available, I think it might be a good idea to add support for some new python features.
For example, now subclasses of
StrEnum
will be treated as realEnum
s!