Author serhiy.storchaka
Recipients Oren Milman, rhettinger, serhiy.storchaka, veky
Date 2017-09-22.08:43:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.
Date User Action Args
2017-09-22 08:43:32serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, veky, Oren Milman
2017-09-22 08:43:32serhiy.storchakasetmessageid: <>
2017-09-22 08:43:32serhiy.storchakalinkissue31478 messages
2017-09-22 08:43:32serhiy.storchakacreate