Dummy Integral class to test conversion of the Rational to float.
| 16 | |
| 17 | |
| 18 | class DummyIntegral(int): |
| 19 | """Dummy Integral class to test conversion of the Rational to float.""" |
| 20 | |
| 21 | def __mul__(self, other): |
| 22 | return DummyIntegral(super().__mul__(other)) |
| 23 | __rmul__ = __mul__ |
| 24 | |
| 25 | def __truediv__(self, other): |
| 26 | return NotImplemented |
| 27 | __rtruediv__ = __truediv__ |
| 28 | |
| 29 | @property |
| 30 | def numerator(self): |
| 31 | return DummyIntegral(self) |
| 32 | |
| 33 | @property |
| 34 | def denominator(self): |
| 35 | return DummyIntegral(1) |
| 36 | |
| 37 | |
| 38 | class HashTest(unittest.TestCase): |
no outgoing calls
searching dependent graphs…