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

Method __rdivmod__

Lib/test/test_binop.py:171–177  ·  view source on GitHub ↗

Divide two Rats, returning quotient and remainder (reversed args).

(self, other)

Source from the content-addressed store, hash-verified

169 return (x, self - other * x)
170
171 def __rdivmod__(self, other):
172 """Divide two Rats, returning quotient and remainder (reversed args)."""
173 if isint(other):
174 other = Rat(other)
175 elif not isRat(other):
176 return NotImplemented
177 return divmod(other, self)
178
179 def __mod__(self, other):
180 """Take one Rat modulo another."""

Callers 1

Calls 3

isintFunction · 0.85
isRatFunction · 0.85
RatClass · 0.70

Tested by

no test coverage detected