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 serhiy.storchaka
Recipients corona10, ethan smith, gvanrossum, gyu-don, mark.dickinson, serhiy.storchaka, terry.reedy
Date 2021-08-23.05:54:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629698061.65.0.415441950421.issue24234@roundup.psfhosted.org>
In-reply-to
Content
Defining complex.__complex__ and bytes.__bytes__ would not solve anything, because

>>> issubclass(int, SupportsComplex)
False
>>> issubclass(float, SupportsComplex)
False
>>> issubclass(bytearray, SupportsBytes)
False
>>> issubclass(memoryview, SupportsBytes)
False

If SupportsComplex and SupportsBytes are just for "has __complex__/__bytes__ method", they are virtually useless. If their meaning is "can be converted to complex/bytes", it is different story, and it should be fixed be adding subclasshooks which check existence of alternate methods (__float__, __index__, supporting the buffer protocol).
History
Date User Action Args
2021-08-23 05:54:21serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, terry.reedy, mark.dickinson, ethan smith, corona10, gyu-don
2021-08-23 05:54:21serhiy.storchakasetmessageid: <1629698061.65.0.415441950421.issue24234@roundup.psfhosted.org>
2021-08-23 05:54:21serhiy.storchakalinkissue24234 messages
2021-08-23 05:54:21serhiy.storchakacreate