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

feat: rewrite enumerated literals as Enums #633

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

juancarlospaco
Copy link
Contributor

What kind of change does this PR introduce?

  • Rewrite enumerated string literals as actual Enums.

@grdsdev
Copy link
Contributor

grdsdev commented Nov 27, 2024

@juancarlospaco what's the benefits of using the StrEnum instead of Literal?

@juancarlospaco juancarlospaco marked this pull request as ready for review November 27, 2024 12:13
@juancarlospaco
Copy link
Contributor Author

It can check if the value is in the range of the enum, for extra safety.
eg. Provider("INVALID") will complain etc.

Enum can be a more correct representation of "enumerated string values".

Sign up for free to 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.

2 participants