Python/C: unsigned Py_BuildValue, PyInt_FromLong
chris-usenet at hedonism.cx
Wed Feb 25 23:05:47 CET 2004
Mike C. Fletcher wrote:
> Unsigned ints can be longer than Python 32-bit signed integers, so
> either do a check for the high-bit being set and use
> PyLong_FromUnsignedLong for that case and PyInt_FromLong otherwise, or
> just always use PyLong_FromUnsignedLong and eat the slight performance
> penalty of having longs everywhere.
Yes, now that you mention it, it's clear to me. Thanks for your help!
More information about the Python-list