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

Method __mul__

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

Source from the content-addressed store, hash-verified

845 return self
846
847 def __mul__(self, other):
848 if isinstance(other, int):
849 # for CPython compatibility, we cannot use
850 # our __class__ here, but need a real timedelta
851 return timedelta(self._days * other,
852 self._seconds * other,
853 self._microseconds * other)
854 if isinstance(other, float):
855 usec = self._to_microseconds()
856 a, b = other.as_integer_ratio()
857 return timedelta(0, 0, _divide_and_round(usec * a, b))
858 return NotImplemented
859
860 __rmul__ = __mul__
861

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