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

Method __lt__

Lib/test/test_sort.py:162–167  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

160
161 class C:
162 def __lt__(self, other):
163 if L and random.random() < 0.75:
164 L.pop()
165 else:
166 L.append(3)
167 return random.random() < 0.5
168
169 L = [C() for i in range(50)]
170 self.assertRaises(ValueError, L.sort)

Callers 1

__lt__Method · 0.45

Calls 3

randomMethod · 0.45
popMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected