| 58 | |
| 59 | |
| 60 | class Approximate: |
| 61 | def __init__(self, val, places=7): |
| 62 | self.val = val |
| 63 | self.places = places |
| 64 | |
| 65 | def __repr__(self): |
| 66 | return repr(self.val) |
| 67 | |
| 68 | def __eq__(self, other): |
| 69 | return self.val == other or round(abs(self.val - other), self.places) == 0 |
| 70 | |
| 71 | |
| 72 | class ContextList(list): |
no outgoing calls