@@ -335,9 +335,9 @@ def is_in_system_header(self):
335
335
return conf .lib .clang_Location_isInSystemHeader (self ) # type: ignore [no-any-return]
336
336
337
337
def __eq__ (self , other ):
338
- if not isinstance (other , SourceLocation ):
339
- return False
340
- return conf . lib . clang_equalLocations ( self , other ) # type: ignore [no-any-return]
338
+ return isinstance (other , SourceLocation ) and conf . lib . clang_equalLocations (
339
+ self , other
340
+ )
341
341
342
342
def __ne__ (self , other ):
343
343
return not self .__eq__ (other )
@@ -395,9 +395,9 @@ def end(self):
395
395
return conf .lib .clang_getRangeEnd (self ) # type: ignore [no-any-return]
396
396
397
397
def __eq__ (self , other ):
398
- if not isinstance (other , SourceRange ):
399
- return False
400
- return conf . lib . clang_equalRanges ( self , other ) # type: ignore [no-any-return]
398
+ return isinstance (other , SourceRange ) and conf . lib . clang_equalRanges (
399
+ self , other
400
+ )
401
401
402
402
def __ne__ (self , other ):
403
403
return not self .__eq__ (other )
@@ -1599,9 +1599,7 @@ def from_location(tu: TranslationUnit, location: SourceLocation) -> Cursor | Non
1599
1599
1600
1600
# This function is not null-guarded because it is used in cursor_null_guard itself
1601
1601
def __eq__ (self , other : object ) -> bool :
1602
- if not isinstance (other , Cursor ):
1603
- return False
1604
- return conf .lib .clang_equalCursors (self , other ) # type: ignore [no-any-return]
1602
+ return isinstance (other , Cursor ) and conf .lib .clang_equalCursors (self , other )
1605
1603
1606
1604
# Not null-guarded for consistency with __eq__
1607
1605
def __ne__ (self , other : object ) -> bool :
0 commit comments