[Python-ideas] Py_SIZE of PyLongs

Elliot Gorokhovsky elliot.gorokhovsky at gmail.com
Wed Oct 19 21:04:32 EDT 2016


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 in the docs, and
I couldn't find it anywhere. Since Py_SIZE is public, I think the
documentation should make clear what it returns for PyLongs, for example
somewhere on the "Integer Objects" page. Apologies if this is specified
somewhere else in the docs and I just couldn't find it.

Elliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161020/cc439f47/attachment-0001.html>


More information about the Python-ideas mailing list