Skip to content

Adds StrEnum support for python3.11 - #12035

Merged
hauntsaninja merged 2 commits into
python:masterfrom
sobolevn:feature-strenum
Feb 9, 2022
Merged

Adds StrEnum support for python3.11#12035
hauntsaninja merged 2 commits into
python:masterfrom
sobolevn:feature-strenum

Conversation

@sobolevn

Copy link
Copy Markdown
Member

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 real Enums!

Comment threadtest-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: ...

Copy link
Copy Markdown
Member

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: ...

Copy link
Copy Markdown
MemberAuthor

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!

@AlexWaygoodAlexWaygoodJan 21, 2022

Copy link
Copy Markdown
Member

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! 😀

@JelleZijlstra

Copy link
Copy Markdown
Member

Did we turn off 3.11 CI completely? I don't see it in the list.

@97littleleaf11

Copy link
Copy Markdown
Collaborator

Yeah we just turned if off. #12003 (comment)

@sobolevnsobolevn mentioned this pull request Feb 6, 2022
@hauntsaninja
hauntsaninja merged commit 37d58c3 into python:masterFeb 9, 2022
sobolevn added a commit that referenced this pull request Feb 22, 2022
After merging #11805 I found out that we are missing several new `Enum` features.
This PR adds them to the docs.
Refs #12026
Refs #12035
@sobolevnsobolevn mentioned this pull request Feb 22, 2022
hauntsaninja pushed a commit that referenced this pull request Feb 23, 2022
After merging #11805 I found out that we are missing several new `Enum` features.
This PR adds them to the docs.
Refs #12026
Refs #12035
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@sobolevn@JelleZijlstra@97littleleaf11@AlexWaygood@hauntsaninja