MCPcopy Index your code
hub / github.com/RustPython/RustPython / __truediv__

Method __truediv__

Lib/_pydatetime.py:866–876  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

864 return timedelta(0, 0, usec // other)
865
866 def __truediv__(self, other):
867 if not isinstance(other, (int, float, timedelta)):
868 return NotImplemented
869 usec = self._to_microseconds()
870 if isinstance(other, timedelta):
871 return usec / other._to_microseconds()
872 if isinstance(other, int):
873 return timedelta(0, 0, _divide_and_round(usec, other))
874 if isinstance(other, float):
875 a, b = other.as_integer_ratio()
876 return timedelta(0, 0, _divide_and_round(b * usec, a))
877
878 def __mod__(self, other):
879 if isinstance(other, timedelta):

Callers

nothing calls this directly

Calls 5

_to_microsecondsMethod · 0.95
isinstanceFunction · 0.85
timedeltaClass · 0.85
_divide_and_roundFunction · 0.85
as_integer_ratioMethod · 0.45

Tested by

no test coverage detected