Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue24234>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to