Skip to content

Add from_str methods to enums #1095

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add from_str methods to enums #1095

wants to merge 1 commit into from

Conversation

ethanbwaite
Copy link
Contributor

Summary: Adds from_str methods to help parse enums from string literals

Differential Revision: D79773872

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 7, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79773872

facebook-github-bot pushed a commit that referenced this pull request Aug 7, 2025
Summary:

Adds from_str methods to help parse enums from string literals

Reviewed By: hokyungh-m

Differential Revision: D79773872
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79773872

@ethanbwaite
Copy link
Contributor Author

The python3.9 tests seem flaky for some reason. Checks passed after 2 retries

ethanbwaite added a commit that referenced this pull request Aug 11, 2025
Summary:

Adds from_str methods to help parse enums from string literals

Reviewed By: hokyungh-m

Differential Revision: D79773872
Summary:
Pull Request resolved: #1095

Adds from_str methods to help parse enums from string literals

Reviewed By: hokyungh-m

Differential Revision: D79773872
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79773872

facebook-github-bot pushed a commit that referenced this pull request Aug 12, 2025
Summary:

Adds from_str methods to help parse enums from string literals

Reviewed By: hokyungh-m

Differential Revision: D79773872
ethanbwaite added a commit that referenced this pull request Aug 12, 2025
Summary:

Adds from_str methods to help parse enums from string literals

Reviewed By: hokyungh-m

Differential Revision: D79773872
@andywag
Copy link
Contributor

andywag commented Aug 13, 2025

Why do you need the from_str method? Isn't there a direct way to do this by using the enum ie ENUM[string_value]

ethanbwaite added a commit that referenced this pull request Aug 13, 2025
Summary:

Adds from_str methods to help parse enums from string literals

Reviewed By: hokyungh-m

Differential Revision: D79773872
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants