@@ -364,7 +364,7 @@ def __init__(self, term: Union[str, UnboundTerm[Any]]):
364364
365365 def __eq__ (self , other : Any ) -> bool :
366366 """Return the equality of two instances of the UnboundPredicate class."""
367- return self .term == other .term if isinstance (other , UnboundPredicate ) else False
367+ return self .term == other .term if isinstance (other , self . __class__ ) else False
368368
369369 @abstractmethod
370370 def bind (self , schema : Schema , case_sensitive : bool = True ) -> BooleanExpression :
@@ -531,7 +531,7 @@ def __repr__(self) -> str:
531531
532532 def __eq__ (self , other : Any ) -> bool :
533533 """Return the equality of two instances of the SetPredicate class."""
534- return self .term == other .term and self .literals == other .literals if isinstance (other , SetPredicate ) else False
534+ return self .term == other .term and self .literals == other .literals if isinstance (other , self . __class__ ) else False
535535
536536 def __getnewargs__ (self ) -> Tuple [UnboundTerm [L ], Set [Literal [L ]]]:
537537 """Pickle the SetPredicate class."""
@@ -664,12 +664,6 @@ def __invert__(self) -> In[L]:
664664 """Transform the Expression into its negated version."""
665665 return In [L ](self .term , self .literals )
666666
667- def __eq__ (self , other : Any ) -> bool :
668- """Return the equality of two instances of the NotIn class."""
669- if isinstance (other , NotIn ):
670- return self .term == other .term and self .literals == other .literals
671- return False
672-
673667 @property
674668 def as_bound (self ) -> Type [BoundNotIn [L ]]:
675669 return BoundNotIn [L ]
@@ -701,7 +695,7 @@ def bind(self, schema: Schema, case_sensitive: bool = True) -> BoundLiteralPredi
701695
702696 def __eq__ (self , other : Any ) -> bool :
703697 """Return the equality of two instances of the LiteralPredicate class."""
704- if isinstance (other , LiteralPredicate ):
698+ if isinstance (other , self . __class__ ):
705699 return self .term == other .term and self .literal == other .literal
706700 return False
707701
0 commit comments