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

Method reverse

Lib/fractions.py:711–720  ·  view source on GitHub ↗
(b, a)

Source from the content-addressed store, hash-verified

709 forward.__doc__ = monomorphic_operator.__doc__
710
711 def reverse(b, a):
712 if isinstance(a, numbers.Rational):
713 # Includes ints.
714 return monomorphic_operator(Fraction(a), b)
715 elif isinstance(a, numbers.Real):
716 return fallback_operator(float(a), float(b))
717 elif handle_complex and isinstance(a, numbers.Complex):
718 return fallback_operator(complex(a), float(b))
719 else:
720 return NotImplemented
721 reverse.__name__ = '__r' + fallback_operator.__name__ + '__'
722 reverse.__doc__ = monomorphic_operator.__doc__
723

Callers 13

src.mjsFile · 0.45
_groupFunction · 0.45
_expand_langFunction · 0.45
extract_stackFunction · 0.45
__methodDictFunction · 0.45
reverse_orderMethod · 0.45
lasti2linenoFunction · 0.45
get_stackMethod · 0.45
_divmod_posFunction · 0.45
_wrap_chunksMethod · 0.45
for_uopMethod · 0.45

Calls 1

FractionClass · 0.85

Tested by

no test coverage detected