Message302740
| 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:32 | serhiy.storchaka | set | recipients: + serhiy.storchaka, rhettinger, veky, Oren Milman |
| 2017-09-22 08:43:32 | serhiy.storchaka | set | messageid: <1506069812.26.0.987746072669.issue31478@psf.upfronthosting.co.za> |
| 2017-09-22 08:43:32 | serhiy.storchaka | link | issue31478 messages |
| 2017-09-22 08:43:32 | serhiy.storchaka | create | |