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

Method __rtruediv__

Lib/test/test_binop.py:138–146  ·  view source on GitHub ↗

Divide two Rats, or a Rat and a number (reversed args).

(self, other)

Source from the content-addressed store, hash-verified

136 return NotImplemented
137
138 def __rtruediv__(self, other):
139 """Divide two Rats, or a Rat and a number (reversed args)."""
140 if isRat(other):
141 return Rat(other.__num*self.__den, other.__den*self.__num)
142 if isint(other):
143 return Rat(other*self.__den, self.__num)
144 if isnum(other):
145 return other / float(self)
146 return NotImplemented
147
148 def __floordiv__(self, other):
149 """Divide two Rats, returning the floored result."""

Callers

nothing calls this directly

Calls 4

isRatFunction · 0.85
isintFunction · 0.85
isnumFunction · 0.85
RatClass · 0.70

Tested by

no test coverage detected