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

Class Complains

Lib/test/test_sort.py:51–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 sizes.extend([10, 100, 1000])
50
51 class Complains(object):
52 maybe_complain = True
53
54 def __init__(self, i):
55 self.i = i
56
57 def __lt__(self, other):
58 if Complains.maybe_complain and random.random() < 0.001:
59 if verbose:
60 print(" complaining at", self, other)
61 raise RuntimeError
62 return self.i < other.i
63
64 def __repr__(self):
65 return "Complains(%d)" % self.i
66
67 class Stable(object):
68 def __init__(self, key, i):

Callers 1

testStressfullyMethod · 0.85

Calls

no outgoing calls

Tested by 1

testStressfullyMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…