@@ -219,7 +219,7 @@ def __hash__(self):
219219 return hash (self ._sortkey )
220220
221221 def __eq__ (self , other ):
222- if other is None :
222+ if not isinstance ( other , type ( self )) :
223223 return False
224224 if self ._company != other ._company :
225225 return False
@@ -232,6 +232,8 @@ def __eq__(self, other):
232232 def __gt__ (self , other ):
233233 if other is None :
234234 return True
235+ if not isinstance (other , type (self )):
236+ return False
235237 if self ._company != other ._company :
236238 return self ._company > other ._company
237239 if self ._sortkey != other ._sortkey :
@@ -243,6 +245,8 @@ def __gt__(self, other):
243245 def matches_bound (self , other ):
244246 if other is None :
245247 return True
248+ if not isinstance (other , type (self )):
249+ return False
246250 if not self ._company .startswith (other ._company ):
247251 return False
248252 if other .platform not in (self .platform , "" ):
@@ -260,6 +264,8 @@ def matches_bound(self, other):
260264 def above_lower_bound (self , other ):
261265 if other is None :
262266 return True
267+ if not isinstance (other , type (self )):
268+ return False
263269 if not self ._company .startswith (other ._company ):
264270 return False
265271 if other .platform not in (self .platform , "" ):
@@ -275,7 +281,7 @@ def above_lower_bound(self, other):
275281 return True
276282
277283 def __lt__ (self , other ):
278- if other is None :
284+ if not isinstance ( other , type ( self )) :
279285 return False
280286 if self ._company != other ._company :
281287 return self ._company < other ._company
@@ -288,6 +294,8 @@ def __lt__(self, other):
288294 def below_upper_bound (self , other ):
289295 if other is None :
290296 return True
297+ if not isinstance (other , type (self )):
298+ return False
291299 if not self ._company .startswith (other ._company ):
292300 return False
293301 if other .platform not in (self .platform , "" ):
0 commit comments