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 avrahami.ben
Recipients avrahami.ben, eric.smith, gvanrossum, python-dev, rhettinger
Date 2020-10-02.08:04:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Good points all, that I will try to address one by one:

Firstly, this function is by no means mandatory for "post-creation mixins". Such tools can still be used without calling it (and remain ABC unaware), with absolutely no change in functionality. Indeed, the function itself can be used as a decorator for just such cases, where a tool is ABC unaware (either from deciding that ABC aren't a use case for them, or from simply not considering that possibility), but the user wants to also subclass an ABC. The problem is that, right now, post-creation tools simply can't be ABC aware.

The thought that few tools are ABC aware is not, I think, a good reason to neglect tools that would like to be. Just as dispatch and type-routing tools might not be ABC aware to use `abc.get_cache_token()`, but it is still added for tools that want to be ABC aware and sidestep this confusing behavior.

As for not occurring in practice: a simple github search reveals many instances of comparison operators being abstract, and while likely few of them likely use dataclasses, that is a possibility that I believe should be addressed (of course, we could decide that this is desired behavior, and scrap this whole issue).

Finally, total_ordering: I originally added it to the issue because it was the other decorator mixin in the standard library, after I rand into this behavior using dataclasses. If total_ordering proves to be a barrier, we can remove it from the PR (and perhaps re-introduce it later if that is deemed necessary). I will only remark that I find total_ordering used in many hand-rolled classes where users would sacrifice some performance for cleaner code and an assertion that total order is enforced.

Sorry for the scroll and thanks for the scrutiny :-)
Date User Action Args
2020-10-02 08:04:15avrahami.bensetrecipients: + avrahami.ben, gvanrossum, rhettinger, eric.smith, python-dev
2020-10-02 08:04:15avrahami.bensetmessageid: <>
2020-10-02 08:04:15avrahami.benlinkissue41905 messages
2020-10-02 08:04:14avrahami.bencreate