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

Method __floordiv__

Lib/test/test_binop.py:148–155  ·  view source on GitHub ↗

Divide two Rats, returning the floored result.

(self, other)

Source from the content-addressed store, hash-verified

146 return NotImplemented
147
148 def __floordiv__(self, other):
149 """Divide two Rats, returning the floored result."""
150 if isint(other):
151 other = Rat(other)
152 elif not isRat(other):
153 return NotImplemented
154 x = self/other
155 return x.__num // x.__den
156
157 def __rfloordiv__(self, other):
158 """Divide two Rats, returning the floored result (reversed args)."""

Callers

nothing calls this directly

Calls 3

isintFunction · 0.85
isRatFunction · 0.85
RatClass · 0.70

Tested by

no test coverage detected