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

Handle enum variants that conflict with EnumTypeWrapper methods #238

Closed
nipunn1313 opened this issue Jul 9, 2021 · 1 comment · Fixed by #246
Closed

Handle enum variants that conflict with EnumTypeWrapper methods #238

nipunn1313 opened this issue Jul 9, 2021 · 1 comment · Fixed by #246

Comments

@nipunn1313
Copy link
Owner

Eg

enum E {
    Name = 1;
    Value = 2;
}

Currently, it generates working python code, but broken stubs.
In python code - this all works.

from test_pb2 import E, Name, Value
assert Name == 1
assert Value == 2
assert E.Name(1) == 'Name'
assert E.Value('Name') == 1
@nipunn1313
Copy link
Owner Author

Probably pay attention to the discussion in protocolbuffers/protobuf#8803 - it seems likely the authors haven't thought about this case carefully.

nipunn1313 added a commit that referenced this issue Jul 15, 2021
…fields

For example, the following has a field which conflicts
with a method on the EnumTypeWrapper class.
```
enum {
  Name = 1;
}
```

Fixes #238
nipunn1313 added a commit that referenced this issue Jul 15, 2021
…fields

For example, the following has a field which conflicts
with a method on the EnumTypeWrapper class.
```
enum {
  Name = 1;
}
```

Fixes #238
nipunn1313 added a commit that referenced this issue Jul 15, 2021
…fields (#246)

For example, the following has a field which conflicts
with a method on the EnumTypeWrapper class.
```
enum {
  Name = 1;
}
```

Fixes #238
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 a pull request may close this issue.

1 participant