This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <1506069812.26.0.987746072669.issue31478@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-09-22 08:43:32serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, veky, Oren Milman
2017-09-22 08:43:32serhiy.storchakasetmessageid: <1506069812.26.0.987746072669.issue31478@psf.upfronthosting.co.za>
2017-09-22 08:43:32serhiy.storchakalinkissue31478 messages
2017-09-22 08:43:32serhiy.storchakacreate