From 441844b97a0e744430e62f850bd66dfc09915b1f Mon Sep 17 00:00:00 2001 From: Erik Friese Date: Thu, 31 Aug 2023 13:18:07 +0200 Subject: [PATCH] avoiding name clash --- src/betterproto/plugin/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/betterproto/plugin/models.py b/src/betterproto/plugin/models.py index ea819d4..479ecee 100644 --- a/src/betterproto/plugin/models.py +++ b/src/betterproto/plugin/models.py @@ -142,12 +142,12 @@ def monkey_patch_oneof_index(): "betterproto" ], "group", - "oneof_index", + "_oneof_index", ) object.__setattr__( Field.__dataclass_fields__["oneof_index"].metadata["betterproto"], "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. """ - 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