MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __truediv__

Method __truediv__

tools/python-3.11.9-amd64/Lib/datetime.py:809–819  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

807 return timedelta(0, 0, usec // other)
808
809 def __truediv__(self, other):
810 if not isinstance(other, (int, float, timedelta)):
811 return NotImplemented
812 usec = self._to_microseconds()
813 if isinstance(other, timedelta):
814 return usec / other._to_microseconds()
815 if isinstance(other, int):
816 return timedelta(0, 0, _divide_and_round(usec, other))
817 if isinstance(other, float):
818 a, b = other.as_integer_ratio()
819 return timedelta(0, 0, _divide_and_round(b * usec, a))
820
821 def __mod__(self, other):
822 if isinstance(other, timedelta):

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected