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

Class FooStr

Lib/test/test_float.py:226–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224 # Issue 5759: __float__ not called on str subclasses (though it is on
225 # unicode subclasses).
226 class FooStr(str):
227 def __float__(self):
228 return float(str(self)) + 1
229
230 self.assertEqual(float(FloatLike(42.)), 42.)
231 self.assertEqual(float(Foo2()), 42.)

Callers 1

test_floatconversionMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_floatconversionMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…