diff --git a/Lib/functools.py b/Lib/functools.py index 0873f207154b7d..23ad16093007e9 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -193,7 +193,7 @@ def _lt_from_ge(self, other, NotImplemented=NotImplemented): def total_ordering(cls): """Class decorator that fills in missing ordering methods""" # 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: raise ValueError('must define at least one ordering operation: < > <= >=') root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__