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 gvanrossum
Recipients avrahami.ben, eric.smith, gvanrossum, python-dev, rhettinger
Date 2020-10-03.15:43:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601739823.92.0.120040049784.issue41905@roundup.psfhosted.org>
In-reply-to
Content
Ah, okay. I wasn't familiar with @total_ordering so I assumed differently.  Sorry for the continued misunderstanding.

Perhaps we should just leave it alone completely then, since ISTM that any change to its implementation may cause subtle bugs in currently working code.

The problem you see only occurs when there are abstract ordering methods present. The cure is simple, just implement all four comparison functions (and do away with @total_ordering). This is not a great burden. Instead we should probably add a line or two to the docs explaining how it interacts with ABCs defining abstract ordering methods.

@dataclass uses a different approach ("is it defined in the current class?"). That is perfectly ready for a call to abc.update_abstractmethods(). (I checked, and dataclasses already depends on abc, indirectly via functools, so the extra import is free.)
History
Date User Action Args
2020-10-03 15:43:43gvanrossumsetrecipients: + gvanrossum, rhettinger, eric.smith, python-dev, avrahami.ben
2020-10-03 15:43:43gvanrossumsetmessageid: <1601739823.92.0.120040049784.issue41905@roundup.psfhosted.org>
2020-10-03 15:43:43gvanrossumlinkissue41905 messages
2020-10-03 15:43:43gvanrossumcreate