avoiding name clash

This commit is contained in:
Erik Friese 2023-08-31 13:18:07 +02:00
parent a413d08fc1
commit 441844b97a

View File

@ -142,12 +142,12 @@ def monkey_patch_oneof_index():
"betterproto" "betterproto"
], ],
"group", "group",
"oneof_index", "_oneof_index",
) )
object.__setattr__( object.__setattr__(
Field.__dataclass_fields__["oneof_index"].metadata["betterproto"], Field.__dataclass_fields__["oneof_index"].metadata["betterproto"],
"group", "group",
"oneof_index", "_oneof_index",
) )
@ -385,7 +385,7 @@ def is_oneof(proto_field_obj: FieldDescriptorProto) -> bool:
us to tell whether it was set, via the which_one_of interface. us to tell whether it was set, via the which_one_of interface.
""" """
return which_one_of(proto_field_obj, "oneof_index")[0] == "oneof_index" return which_one_of(proto_field_obj, "_oneof_index")[0] == "oneof_index"
@dataclass @dataclass