MCPcopy Index your code
hub / github.com/python/cpython / MyFloat

Class MyFloat

Lib/test/test_statistics.py:972–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970 x = statistics._convert(Fraction(-1, 2), float)
971 self.check_exact_equal(x, -0.5)
972 class MyFloat(float):
973 def __truediv__(self, other):
974 return self.__class__(super().__truediv__(other))
975 x = statistics._convert(Fraction(9, 8), MyFloat)
976 self.check_exact_equal(x, MyFloat(1.125))
977

Callers 2

test_float_nanMethod · 0.70
test_floatMethod · 0.70

Calls

no outgoing calls

Tested by 2

test_float_nanMethod · 0.56
test_floatMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…