Kaydet (Commit) 3255c63e authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Improve comment

üst 86909b50
...@@ -81,7 +81,7 @@ def total_ordering(cls): ...@@ -81,7 +81,7 @@ def total_ordering(cls):
('__gt__', lambda self, other: not other >= self), ('__gt__', lambda self, other: not other >= self),
('__lt__', lambda self, other: not self >= other)] ('__lt__', lambda self, other: not self >= other)]
} }
# Find comparisons not inherited from object. # Find user-defined comparisons (not those inherited from object).
roots = [op for op in convert if getattr(cls, op, None) is not getattr(object, op, None)] roots = [op for op in convert if getattr(cls, op, None) is not getattr(object, op, None)]
if not roots: if not roots:
raise ValueError('must define at least one ordering operation: < > <= >=') raise ValueError('must define at least one ordering operation: < > <= >=')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment