[Python-Dev] Python's C interface for types

Josiah Carlson jcarlson at uci.edu
Fri Jan 26 20:49:27 CET 2007


Nick Maclaren <nmm1 at cus.cam.ac.uk> wrote:
> 
> Oops.  Something else fairly major I forgot to ask.  Python long.
> I can't find any clean way of converting to or from this, and
> would much rather not build a knowledge of long's internals into
> my code.  Going via text is, of course, possible - but is not very
> efficient, even using hex/octal.

See _PyLong_FromByteArray and _PyLong_AsByteArray .

 - Josiah



More information about the Python-Dev mailing list