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

Class PointlessComparator

Lib/test/test_sort.py:358–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356 # The following test is also by ppperry. It ensures that
357 # unsafe_object_compare handles Py_NotImplemented appropriately.
358 class PointlessComparator:
359 def __lt__(self, other):
360 return NotImplemented
361 L = [PointlessComparator(), PointlessComparator()]
362 self.assertRaises(TypeError, L.sort)
363 self.assertRaises(TypeError, [(x,) for x in L].sort)

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…