You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In generated field name, an undescore is introduced after a number #657
Underscore is added after a number in the field name, e.g. c2s becomes c2_s.
Reproduction Steps
syntax="proto3";
messageExample {
stringc2s=1;
}
protoc --python_betterproto_out=lib example.proto
Expected Results
Expecting c2s.
# Generated by the protocol buffer compiler. DO NOT EDIT!# sources: example.proto# plugin: python-betterproto# This file has been @generatedfromdataclassesimportdataclassimportbetterproto@dataclass(eq=False, repr=False)classExample(betterproto.Message):
c2s: str=betterproto.string_field(1)
Actual Results
Generates c2_s instead.
# Generated by the protocol buffer compiler. DO NOT EDIT!# sources: example.proto# plugin: python-betterproto# This file has been @generatedfromdataclassesimportdataclassimportbetterproto@dataclass(eq=False, repr=False)classExample(betterproto.Message):
c2_s: str=betterproto.string_field(1)
Activity
YodaEmbedding commentedon Mar 16, 2025
Proposed fix:
Tests:
Much nicer. :)