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

Support Literal for from_environment_as_dataclass #95

Open
ric-evans opened this issue Mar 8, 2024 · 0 comments
Open

Support Literal for from_environment_as_dataclass #95

ric-evans opened this issue Mar 8, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ric-evans
Copy link
Member

Using typing.Literal makes it clear what the valid values are. Alternatively/additionally, support using Enum names as values--this is already possible for enum values, ex: BuildType(200) -> <BuildType.debug: 200>, but this way is not as useful for lookup.

Ex:

EWMS_PILOT_HTCHIRP_DEST: Literal["JOB_EVENT_LOG", "JOB_ATTR"] = "JOB_ATTR"
@ric-evans ric-evans added the enhancement New feature or request label Mar 8, 2024
@ric-evans ric-evans self-assigned this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant