Serhiy Storchaka added the comment:

The more I think about this the more I like the idea of using int.__abs__() 
directly (PyLong_Type.tp_as_number->nb_absolute() in C). The C code doesn't 
call potentially overridable methods bit_length() and to_bytes(), it uses 
concrete implementations directly. I don't see reasons why it should obey 
overriding the __abs__() method.

This will save us from the problem with the wording of the error message.

I mentioned a drawback, but the current implementation has the same drawback. 
We can avoid copying positive integer subtypes by using more complex code, but 
I think it isn't worth.

----------
versions: +Python 2.7, Python 3.6

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

Reply via email to