-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Enum values not defined in enum class #6028
Comments
Oh, we updated the document earlier than it should be. The getattr is added in this PR which is not release in v3.7.1: |
what's the correct way to get the value of an enum then? |
@pkalebu It looks like you have to do |
@markisus Thanks for this, looks like the documentation needs quite some updates to conform to Proto3 😅 Would've needed to read the actual commit changes to get the answer to read the enum values. Do they have their documentation source open? |
…support older protoc versions. (protocolbuffers/protobuf#6028) PiperOrigin-RevId: 310545935
The documentation for enum says:
But
value-a = myproto_pb2.SomeEnum.VALUE_A
fails.What version of protobuf and what language are you using?
Version: v3.7.1/v3.6.1
Language: Python
What operating system (Linux, Windows, ...) and version?
Xubuntu 18.04
What runtime / compiler are you using (e.g., python version or gcc version)
gcc
What did you do?
myproto.proto
.What did you expect to see
What did you see instead?
The text was updated successfully, but these errors were encountered: