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

Method _cmp

src/pendulum/interval.py:370–379  ·  view source on GitHub ↗
(self, other: timedelta)

Source from the content-addressed store, hash-verified

368 return self.__repr__()
369
370 def _cmp(self, other: timedelta) -> int:
371 # Only needed for PyPy
372 assert isinstance(other, timedelta)
373
374 if isinstance(other, Interval):
375 other = other.as_timedelta()
376
377 td = self.as_timedelta()
378
379 return 0 if td == other else 1 if td > other else -1
380
381 def _getstate(self, protocol: SupportsIndex = 3) -> tuple[_T, _T, bool]:
382 start, end = self.start, self.end

Callers

nothing calls this directly

Calls 1

as_timedeltaMethod · 0.80

Tested by

no test coverage detected