Skip to content

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.

2 participants