MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / subtract_timedelta

Method subtract_timedelta

src/pendulum/time.py:153–162  ·  view source on GitHub ↗

Remove timedelta duration from the instance. :param delta: The timedelta instance

(self, delta: datetime.timedelta)

Source from the content-addressed store, hash-verified

151 return self.add(seconds=delta.seconds, microseconds=delta.microseconds)
152
153 def subtract_timedelta(self, delta: datetime.timedelta) -> Time:
154 """
155 Remove timedelta duration from the instance.
156
157 :param delta: The timedelta instance
158 """
159 if delta.days:
160 raise TypeError("Cannot subtract timedelta with days to Time.")
161
162 return self.subtract(seconds=delta.seconds, microseconds=delta.microseconds)
163
164 def __add__(self, other: datetime.timedelta) -> Time:
165 if not isinstance(other, timedelta):

Callers 3

__sub__Method · 0.95
test_subtract_timedeltaFunction · 0.95

Calls 1

subtractMethod · 0.95

Tested by 2

test_subtract_timedeltaFunction · 0.76