Closed
Description
Hiya,
I've just started working with gather.town which provides a version 3 proto file. I had to remove the optional keywords (as best I can tell, they're somewhat unnecessary in proto3 files) and it all started generating fine. I found, however, that when importing the file that the following enum:
message EmoteEnum {
enum ENUM {
None = 0;
Wave = 1;
Heart = 2;
PartyPopper = 3;
ThumbsUp = 4;
QuestionMark = 5;
RaisedHand = 6;
}
}
generates the following dataclass:
class EmoteEnumENUM(betterproto.Enum):
None = 0
Wave = 1
Heart = 2
PartyPopper = 3
ThumbsUp = 4
QuestionMark = 5
RaisedHand = 6
which tries to assign to None. There doesn't appear to be a great mechanism for working around this automatically. The best I've found would be to append an _
and documenting that this would happen to any field name found in keyword.kwlist. There is a workaround for dataclasses-json
, but obviously that's not a default package with python and doesn't look like a suitable solution to the issue...
Metadata
Metadata
Assignees
Labels
No labels