-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add enum parser #185
Add enum parser #185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good. Just some nitpicking to address.
Applied the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more tiny changes
b709959
to
7950065
Compare
Updated the readme, and left a comment on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'll merge and release this soon when I'm off the clock
@env.parser_for("enum") | ||
def enum_parser(value, choices): | ||
@env.parser_for("choice") | ||
def choice_parser(value, choices): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought (non-blocking): We might want to come up with a different example here since users would use env.enum
for this use case rather than a custom parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the example isn't that bad for now, this deserves a separate issue anyway.
The enum parser receives the enum type and parses the enum by its name.