MCPcopy
hub / github.com/django/django / Approximate

Class Approximate

django/test/utils.py:60–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59
60class 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
72class ContextList(list):

Calls

no outgoing calls