This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients avrahami.ben, eric.smith, gvanrossum, python-dev, rhettinger
Date 2020-10-02.16:27:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
You might be misunderstanding what @total_ordering does.  It can't be used by subclasses to override abstract methods.

>>> from abc import abstractmethod, ABC
>>> from functools import total_ordering

>>> class X(ABC):
	def __lt__(self, other):
		raise RuntimeError('abstract called')

>>> @total_ordering
class Y(X):
    def __le__(self, other):
        return True

>>> sorted(vars(Y))    # note that __lt__ is missing and Y() won't instantiate
['__abstractmethods__', '__doc__', '__ge__', '__gt__', '__le__', '__module__', '_abc_impl']
Date User Action Args
2020-10-02 16:27:58rhettingersetrecipients: + rhettinger, gvanrossum, eric.smith, python-dev, avrahami.ben
2020-10-02 16:27:58rhettingersetmessageid: <>
2020-10-02 16:27:58rhettingerlinkissue41905 messages
2020-10-02 16:27:58rhettingercreate