| Total Complexity | 8 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from typing import Any |
||
| 2 | |||
| 3 | from abc import ABC, abstractmethod |
||
| 4 | |||
| 5 | |||
| 6 | class Comparison(ABC): |
||
| 7 | @abstractmethod |
||
| 8 | def check(self, x: Any, y: Any) -> bool: # pragma: no cover |
||
| 9 | raise NotImplementedError |
||
| 10 | |||
| 11 | |||
| 12 | class NoOp(Comparison): |
||
| 13 | def check(self, x: Any, y: Any) -> bool: |
||
| 14 | return True |
||
| 15 | |||
| 16 | |||
| 17 | class Equal(Comparison): |
||
| 18 | def check(self, x: Any, y: Any) -> bool: |
||
| 19 | return x == y |
||
| 20 | |||
| 21 | |||
| 22 | class NotEqual(Comparison): |
||
| 23 | def check(self, x: Any, y: Any) -> bool: |
||
| 24 | return x != y |
||
| 25 | |||
| 26 | |||
| 27 | class GreaterThan(Comparison): |
||
| 28 | def check(self, x: Any, y: Any) -> bool: |
||
| 29 | return x > y |
||
| 30 | |||
| 31 | |||
| 32 | class GreaterThanOrEqual(Comparison): |
||
| 33 | def check(self, x: Any, y: Any) -> bool: |
||
| 34 | return x >= y |
||
| 35 | |||
| 36 | |||
| 37 | class LessThan(Comparison): |
||
| 38 | def check(self, x: Any, y: Any) -> bool: |
||
| 39 | return x < y |
||
| 40 | |||
| 41 | |||
| 42 | class LessThanOrEqual(Comparison): |
||
| 43 | def check(self, x: Any, y: Any) -> bool: |
||
| 44 | return x <= y |
||
| 45 |