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

Method make_comparable

Lib/xmlrpc/client.py:282–298  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

280 self.value = _strftime(value)
281
282 def make_comparable(self, other):
283 if isinstance(other, DateTime):
284 s = self.value
285 o = other.value
286 elif isinstance(other, datetime):
287 s = self.value
288 o = _iso8601_format(other)
289 elif isinstance(other, str):
290 s = self.value
291 o = other
292 elif hasattr(other, "timetuple"):
293 s = self.timetuple()
294 o = other.timetuple()
295 else:
296 s = self
297 o = NotImplemented
298 return s, o
299
300 def __lt__(self, other):
301 s, o = self.make_comparable(other)

Callers 5

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

Calls 2

timetupleMethod · 0.95
_iso8601_formatFunction · 0.85

Tested by

no test coverage detected