Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c075f07 commit 56de7e2Copy full SHA for 56de7e2
1 file changed
Lib/functools.py
@@ -67,8 +67,9 @@ def total_ordering(cls):
67
('__lt__', lambda self, other: not self >= other)]
68
}
69
roots = set(dir(cls)) & set(convert)
70
- assert roots, 'must define at least one ordering operation: < > <= >='
71
- root = max(roots) # prefer __lt __ to __le__ to __gt__ to __ge__
+ if not roots:
+ raise ValueError('must define at least one ordering operation: < > <= >=')
72
+ root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__
73
for opname, opfunc in convert[root]:
74
if opname not in roots:
75
opfunc.__name__ = opname
0 commit comments