File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 138
138
" new_predicates = Predicates(self, operator='NOT')\n " ,
139
139
" return new_predicates\n " ,
140
140
" \n " ,
141
+ " def __eq__(self, other):\n " ,
142
+ " if not isinstance(other, Predicates):\n " ,
143
+ " return False\n " ,
144
+ " \n " ,
145
+ " return (\n " ,
146
+ " self.operator == other.operator and\n " ,
147
+ " self.clauses == other.clauses\n " ,
148
+ " )\n " ,
149
+ " \n " ,
141
150
" def __repr__(self):\n " ,
142
151
" if self.operator:\n " ,
143
152
" return f\" {self.operator}({', '.join(repr(clause) for clause in self.clauses)})\"\n " ,
Original file line number Diff line number Diff line change 36
36
'timescale_vector.client.Predicates' : ('vector.html#predicates' , 'timescale_vector/client.py' ),
37
37
'timescale_vector.client.Predicates.__and__' : ( 'vector.html#predicates.__and__' ,
38
38
'timescale_vector/client.py' ),
39
+ 'timescale_vector.client.Predicates.__eq__' : ( 'vector.html#predicates.__eq__' ,
40
+ 'timescale_vector/client.py' ),
39
41
'timescale_vector.client.Predicates.__init__' : ( 'vector.html#predicates.__init__' ,
40
42
'timescale_vector/client.py' ),
41
43
'timescale_vector.client.Predicates.__invert__' : ( 'vector.html#predicates.__invert__' ,
Original file line number Diff line number Diff line change @@ -62,6 +62,15 @@ def __invert__(self):
62
62
new_predicates = Predicates (self , operator = 'NOT' )
63
63
return new_predicates
64
64
65
+ def __eq__ (self , other ):
66
+ if not isinstance (other , Predicates ):
67
+ return False
68
+
69
+ return (
70
+ self .operator == other .operator and
71
+ self .clauses == other .clauses
72
+ )
73
+
65
74
def __repr__ (self ):
66
75
if self .operator :
67
76
return f"{ self .operator } ({ ', ' .join (repr (clause ) for clause in self .clauses )} )"
You can’t perform that action at this time.
0 commit comments