Large integers from C

Tim Peters tim.one at comcast.net
Fri Feb 22 01:54:47 EST 2002


[John Machin]
> In this case as the OP in essence pointed out,
> PyLong_FromSomeFormatLongerThanCLongLong()would be very useful for
> punters who somehow are generating such beasties themselves.
> _PyLong_FromByteArray() exposes no implementation details that are
> private to longobject.c. Do you have any objection to removing the _
> and getting the comments in the .h file copied into the C API manual?

"It depends", on whether stronger reasons to change the C API pop up.  When
we change the C API, PYTHON_API_VERSION (in modsupport.h) gets bumped, and
then Python whines if extension modules don't get recompiled.  That can be a
real pain for the users least able to deal with it, so changes to the public
C API are resisted.  (Heh -- people on Windows have no idea that Python
sometimes *is* binary-compatible across minor releases, because a different
mechanism forces recompilation regardless on Windows; the pain I'm talking
about is a non-Windows pain.)

I don't see enough demand for this particular function alone to justify the
pain.  If it can ride in on some other change's coattails, then its inverse
(_PyLong_AsByteArray) should get blessed at the same time.





More information about the Python-list mailing list