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

Method as_duration

src/pendulum/interval.py:307–311  ·  view source on GitHub ↗

Return the Interval as a Duration.

(self)

Source from the content-addressed store, hash-verified

305 i += amount
306
307 def as_duration(self) -> Duration:
308 """
309 Return the Interval as a Duration.
310 """
311 return Duration(seconds=self.total_seconds())
312
313 def __iter__(self) -> Iterator[_T]:
314 return self.range("days")

Callers 8

__add__Method · 0.95
__sub__Method · 0.95
__mul__Method · 0.95
__floordiv__Method · 0.95
__truediv__Method · 0.95
__mod__Method · 0.95
__divmod__Method · 0.95
__eq__Method · 0.95

Calls 2

DurationClass · 0.90
total_secondsMethod · 0.45

Tested by

no test coverage detected