Message362727
The reason why there was the PyInt_AS_LONG macro is that it is very simple and efficient. It never fails, because the value of the int object always fits in the C long. PyInt_AsLong is much slower. If you know that the object is int, you can use PyInt_AS_LONG for performance and simplicity.
In contrary, converting the long object to the C long value requires a loop and it can overflow. There is no reason to implement it as a macro. You can use the PyLong_AsLong function. |
|
Date |
User |
Action |
Args |
2020-02-26 20:02:42 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ngie |
2020-02-26 20:02:42 | serhiy.storchaka | set | messageid: <1582747362.11.0.551756934837.issue39762@roundup.psfhosted.org> |
2020-02-26 20:02:42 | serhiy.storchaka | link | issue39762 messages |
2020-02-26 20:02:42 | serhiy.storchaka | create | |
|