If a class implements both __index__() and __bytes__(), the built-in bytes() constructor uses __index__() in place of __bytes__(), including the assumption that __index__() returns a bytes object. Attaching a simple example (leads to overflow when big integer is casted to bytes).
BTW, Руслан, can you change your name to use latin alphabet? I'm Андрей Светлов, but use Andrew Svetlov for tracker. Latin transcription is much easier to remember for all python users who don't speak Russian. For that guys your name looks like Chinese one for me. Thanks.
Yes, i saw #15559 ( well, actually, i saw the related discussion http://mail.python.org/pipermail/python-dev/2012-August/121241.html ) while looking for an answer. It's more narrow - i.e. manifestation of this issue in ipaddress case where some people actually _needed_ to have different values returned by __index__() and __bytes__(), and had to work around it. As for my name, my username is used almost everywhere and, unlike my real name, it's easy to read and remember. The only place where usernames aren't mentioned are mails from the Python issue tracker. File a bug for it.