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

Function randfraction

Modules/_decimal/tests/randdec.py:462–467  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

460 return complex(real, imag)
461
462def randfraction():
463 num = randint()
464 denom = randint()
465 if denom == 0:
466 denom = 1
467 return Fraction(num, denom)
468
469number_funcs = [randint, randfloat, randcomplex, randfraction]
470

Callers

nothing calls this directly

Calls 2

FractionClass · 0.90
randintFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…