Skip to content

feat: int mapped to enum #1

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: master
Choose a base branch
from
Open

feat: int mapped to enum #1

wants to merge 1 commit into from

Conversation

augi
Copy link
Member

@augi augi commented Oct 25, 2022

This PR is inspired by danielgtaylor#273

As you can see, the original PR was closed because it didn't handle nicely values that are not defined in the enum.

I believe it is still valuable to have this behavior because it at least reduces the risk of a runtime error (but it doesn't eliminate it completely - for the values without mapping).

Also, if you look at the newly proposed PR in betterproto, the usage will be the same, so we will be prepared for future releases.

@augi augi requested a review from Luminaar October 25, 2022 08:18
@augi
Copy link
Member Author

augi commented Oct 25, 2022

The failing check looks like be related to a broken version of black.

ImportError: cannot import name '_unicodefun' from 'click'

I would prefer to leave it as is in order not to drift far away from the original repository.

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.

1 participant