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

Method _add_timedelta

src/pendulum/date.py:221–235  ·  view source on GitHub ↗

Add timedelta duration to the instance. :param delta: The timedelta instance

(self, delta: timedelta)

Source from the content-addressed store, hash-verified

219 return self.add(years=-years, months=-months, weeks=-weeks, days=-days)
220
221 def _add_timedelta(self, delta: timedelta) -> Self:
222 """
223 Add timedelta duration to the instance.
224
225 :param delta: The timedelta instance
226 """
227 if isinstance(delta, pendulum.Duration):
228 return self.add(
229 years=delta.years,
230 months=delta.months,
231 weeks=delta.weeks,
232 days=delta.remaining_days,
233 )
234
235 return self.add(days=delta.days)
236
237 def _subtract_timedelta(self, delta: timedelta) -> Self:
238 """

Callers 1

__add__Method · 0.95

Calls 1

addMethod · 0.95

Tested by

no test coverage detected