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

Method __mul__

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

Source from the content-addressed store, hash-verified

779 return self
780
781 def __mul__(self, other):
782 if isinstance(other, int):
783 # for CPython compatibility, we cannot use
784 # our __class__ here, but need a real timedelta
785 return timedelta(self._days * other,
786 self._seconds * other,
787 self._microseconds * other)
788 if isinstance(other, float):
789 usec = self._to_microseconds()
790 a, b = other.as_integer_ratio()
791 return timedelta(0, 0, _divide_and_round(usec * a, b))
792 return NotImplemented
793
794 __rmul__ = __mul__
795

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