Skip to content
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

[docs] gh-101273: Expand enum documentation on limitations #101274

Closed
wants to merge 1 commit into from

Conversation

samypr100
Copy link
Contributor

@samypr100 samypr100 commented Jan 23, 2023

@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Jan 23, 2023
Copy link
Member

@ethanfurman ethanfurman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this needs to be in the docs; I am sure that this is not the right section for them to be in. I'll try to review the enum docs this week to see if there is a better spot for this warning.

@samypr100
Copy link
Contributor Author

@ethanfurman To expand a little on the motivation, the codebase that I originally encountered this had something close to

class ElementType(StrEnum):
    title = "..."
    comment = "..."
    author = "..."
    # ...

It didn't occur to me at first that the errors I was seeing in mypy (mypy was being added after the fact) were due to StrEnum inheriting from str, hence why I also thought that it might be a good idea to add a warning/note to the docs.

@ethanfurman
Copy link
Member

Closing in favor of #103596. Thank you, @samypr100 for the encouragement to properly fix this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expand on enum limitations
4 participants