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

Method __mul__

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

Source from the content-addressed store, hash-verified

836 return self
837
838 def __mul__(self, other):
839 if isinstance(other, int):
840 # for CPython compatibility, we cannot use
841 # our __class__ here, but need a real timedelta
842 return timedelta(self._days * other,
843 self._seconds * other,
844 self._microseconds * other)
845 if isinstance(other, float):
846 usec = self._to_microseconds()
847 a, b = other.as_integer_ratio()
848 return timedelta(0, 0, _divide_and_round(usec * a, b))
849 return NotImplemented
850
851 __rmul__ = __mul__
852

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