_PyLong_FromByteArray

Dan Christensen jdc at uwo.ca
Sat Aug 12 13:33:02 EDT 2006


My student and I are writing a C extension that produces a large
integer in binary which we'd like to convert to a python long.  The
number of bits can be a lot more than 32 or even 64.  My student found
the function _PyLong_FromByteArray in longobject.h which is exactly
what we need, but the leading underscore makes me wary.  Is it safe to
use this function?  Will it continue to exist in future versions of
python?  Or is there some other method we should use?  We'd like
something fairly efficient...

Thanks,

Dan



More information about the Python-list mailing list