Re: [Python-ideas] Py_SIZE of PyLongs

2016-10-19 Thread Tim Peters
[Elliot Gorokhovsky ] > I'm working on a special-case compare function for bounded integers for the > sort stuff. By looking at the implementation, I figured out that Py_SIZE of > a long is the sign times the number of digits (...right?). > ... Please ignore the other reply you got - they clearly

Re: [Python-ideas] Py_SIZE of PyLongs

2016-10-19 Thread Elliot Gorokhovsky
It's in the code. See longobject.c: Py_SIZE(v) = ndigits*sign; You can also see Py_SIZE(v) used on PyLongs all over the place in longobject.c, for example: v = (PyLongObject *)vv; i = Py_SIZE(v); Just do a ctrl-f for Py_SIZE(v) in longobject.c. Like I said, by looking in the implementat

Re: [Python-ideas] Py_SIZE of PyLongs

2016-10-19 Thread Thomas Nyberg
On 10/19/2016 09:04 PM, Elliot Gorokhovsky wrote: A quick note: I'm working on a special-case compare function for bounded integers for the sort stuff. By looking at the implementation, I figured out that Py_SIZE of a long is the sign times the number of digits (...right?). Before looking at the

[Python-ideas] Py_SIZE of PyLongs

2016-10-19 Thread Elliot Gorokhovsky
A quick note: I'm working on a special-case compare function for bounded integers for the sort stuff. By looking at the implementation, I figured out that Py_SIZE of a long is the sign times the number of digits (...right?). Before looking at the implementation, though, I had looked for this info