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