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
Date 2020-10-01.15:54:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org>
In-reply-to
Content
python-ideas discussion:
https://mail.python.org/archives/list/python-ideas@python.org/thread/6BNJ3YSEBPHEPGXSAZGBW3TJ64ZGZIHE/

In order to allow "decorator mixins" (most notably dataclass and total_ordering) to implement ABCs, new functionality is needed. I propose a new python function in `abc.py` called `update_abstractmethods`. The function will accept a class and, if the class is an instance of ABCMeta, will update the class's `__abstractmethods__` attribute to not include implemented attributes, and to include new abstractmethods (proposed implementation in thread).

Both dataclass and total_ordering will be modified to call this function on the subject class before returning it, and 3rd-party libraries which implement mixin decorators (like attrs) will be to do the same.

Also, the function can be used as a decorator individually, this is especially useful in cases where 3rd party decorators do not call the function.
History
Date User Action Args
2020-10-01 15:54:52avrahami.bensetrecipients: + avrahami.ben
2020-10-01 15:54:52avrahami.bensetmessageid: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org>
2020-10-01 15:54:52avrahami.benlinkissue41905 messages
2020-10-01 15:54:52avrahami.bencreate