MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __rpow__

Method __rpow__

tools/python-3.11.9-amd64/Lib/fractions.py:571–583  ·  view source on GitHub ↗

a ** b

(b, a)

Source from the content-addressed store, hash-verified

569 return float(a) ** b
570
571 def __rpow__(b, a):
572 """a ** b"""
573 if b._denominator == 1 and b._numerator >= 0:
574 # If a is an int, keep it that way if possible.
575 return a ** b._numerator
576
577 if isinstance(a, numbers.Rational):
578 return Fraction(a.numerator, a.denominator) ** b
579
580 if b._denominator == 1:
581 return a ** b._numerator
582
583 return a ** float(b)
584
585 def __pos__(a):
586 """+a: Coerces a subclass instance to Fraction"""

Callers

nothing calls this directly

Calls 1

FractionClass · 0.85

Tested by

no test coverage detected