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

Method _cmp

src/pendulum/datetime.py:1382–1397  ·  view source on GitHub ↗
(self, other: datetime.datetime, **kwargs: Any)

Source from the content-addressed store, hash-verified

1380 )
1381
1382 def _cmp(self, other: datetime.datetime, **kwargs: Any) -> int:
1383 # Fix for pypy which compares using this method
1384 # which would lead to infinite recursion if we didn't override
1385 dt = datetime.datetime(
1386 self.year,
1387 self.month,
1388 self.day,
1389 self.hour,
1390 self.minute,
1391 self.second,
1392 self.microsecond,
1393 tzinfo=self.tz,
1394 fold=self.fold,
1395 )
1396
1397 return 0 if dt == other else 1 if dt > other else -1
1398
1399
1400DateTime.min = DateTime(1, 1, 1, 0, 0, tzinfo=UTC)

Callers

nothing calls this directly

Calls 1

datetimeMethod · 0.45

Tested by

no test coverage detected