File tree 1 file changed +5
-6
lines changed 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -535,26 +535,25 @@ def __post_init__(self) -> None:
535
535
def __raw_get (self , name : str ) -> Any :
536
536
return super ().__getattribute__ (name )
537
537
538
- def __eq__ (self , other ) :
538
+ def __eq__ (self , other : T ) -> bool :
539
539
if type (self ) is not type (other ):
540
540
return False
541
541
542
- equal = True
543
542
for field_name in self ._betterproto .meta_by_field_name :
544
543
self_val = self .__raw_get (field_name )
545
544
other_val = other .__raw_get (field_name )
546
545
if self_val is PLACEHOLDER and other_val is PLACEHOLDER :
547
546
continue
548
- elif self_val is PLACEHOLDER :
547
+
548
+ if self_val is PLACEHOLDER :
549
549
self_val = self ._get_field_default (field_name )
550
550
elif other_val is PLACEHOLDER :
551
551
other_val = other ._get_field_default (field_name )
552
552
553
553
if self_val != other_val :
554
- equal = False
555
- break
554
+ return False
556
555
557
- return equal
556
+ return True
558
557
559
558
def __repr__ (self ) -> str :
560
559
parts = []
You can’t perform that action at this time.
0 commit comments