[docs] Mention how to get/set a bigint PyLong via the C API (#101270)

We don't need direct C APIs to get at a bigint representation of PyLong but we
do want the few people who need to understand how.

Additional Author:  CAM-Gerlach
This commit is contained in:
Gregory P. Smith 2023-01-23 21:20:53 -08:00 committed by GitHub
parent b724ac2fe7
commit e244401ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,10 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
ignored. If there are no digits or *str* is not NULL-terminated following the ignored. If there are no digits or *str* is not NULL-terminated following the
digits and trailing whitespace, :exc:`ValueError` will be raised. digits and trailing whitespace, :exc:`ValueError` will be raised.
.. seealso:: Python methods :meth:`int.to_bytes` and :meth:`int.from_bytes`
to convert a :c:type:`PyLongObject` to/from an array of bytes in base
``256``. You can call those from C using :c:func:`PyObject_CallMethod`.
.. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base) .. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)