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

Method __divmod__

Lib/test/test_binop.py:162–169  ·  view source on GitHub ↗

Divide two Rats, returning quotient and remainder.

(self, other)

Source from the content-addressed store, hash-verified

160 return x.__num // x.__den
161
162 def __divmod__(self, other):
163 """Divide two Rats, returning quotient and remainder."""
164 if isint(other):
165 other = Rat(other)
166 elif not isRat(other):
167 return NotImplemented
168 x = self//other
169 return (x, self - other * x)
170
171 def __rdivmod__(self, other):
172 """Divide two Rats, returning quotient and remainder (reversed args)."""

Callers

nothing calls this directly

Calls 3

isintFunction · 0.85
isRatFunction · 0.85
RatClass · 0.70

Tested by

no test coverage detected