MCPcopy Index your code
hub / github.com/python/cpython / _cmp

Method _cmp

Lib/_pydatetime.py:1212–1217  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

1210 return NotImplemented
1211
1212 def _cmp(self, other):
1213 assert isinstance(other, date)
1214 assert not isinstance(other, datetime)
1215 y, m, d = self._year, self._month, self._day
1216 y2, m2, d2 = other._year, other._month, other._day
1217 return _cmp((y, m, d), (y2, m2, d2))
1218
1219 def __hash__(self):
1220 "Hash."

Callers 5

__eq__Method · 0.95
__le__Method · 0.95
__lt__Method · 0.95
__ge__Method · 0.95
__gt__Method · 0.95

Calls 1

_cmpFunction · 0.70

Tested by

no test coverage detected