MCPcopy Index your code
hub / github.com/RustPython/RustPython / _cmp

Method _cmp

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

Source from the content-addressed store, hash-verified

1195 return NotImplemented
1196
1197 def _cmp(self, other):
1198 assert isinstance(other, date)
1199 assert not isinstance(other, datetime)
1200 y, m, d = self._year, self._month, self._day
1201 y2, m2, d2 = other._year, other._month, other._day
1202 return _cmp((y, m, d), (y2, m2, d2))
1203
1204 def __hash__(self):
1205 "Hash."

Callers 5

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

Calls 2

isinstanceFunction · 0.85
_cmpFunction · 0.70

Tested by

no test coverage detected