A class that is always equal to whatever you compare it to.
| 311 | |
| 312 | |
| 313 | class ComparesEqualClass: |
| 314 | """ |
| 315 | A class that is always equal to whatever you compare it to. |
| 316 | """ |
| 317 | |
| 318 | def __eq__(self, other): |
| 319 | return True |
| 320 | |
| 321 | def __ne__(self, other): |
| 322 | return False |
| 323 | |
| 324 | def __le__(self, other): |
| 325 | return True |
| 326 | |
| 327 | def __ge__(self, other): |
| 328 | return True |
| 329 | |
| 330 | def __lt__(self, other): |
| 331 | return False |
| 332 | |
| 333 | def __gt__(self, other): |
| 334 | return False |
| 335 | |
| 336 | __req__ = __eq__ |
| 337 | __rne__ = __ne__ |
| 338 | __rle__ = __le__ |
| 339 | __rge__ = __ge__ |
| 340 | __rlt__ = __lt__ |
| 341 | __rgt__ = __gt__ |
| 342 | |
| 343 | |
| 344 | ComparesEqual = ComparesEqualClass() |