Message400123
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). |
|
Date |
User |
Action |
Args |
2021-08-23 05:54:21 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, terry.reedy, mark.dickinson, ethan smith, corona10, gyu-don |
2021-08-23 05:54:21 | serhiy.storchaka | set | messageid: <1629698061.65.0.415441950421.issue24234@roundup.psfhosted.org> |
2021-08-23 05:54:21 | serhiy.storchaka | link | issue24234 messages |
2021-08-23 05:54:21 | serhiy.storchaka | create | |
|