gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString() (#121478)

* gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString()

* Update Doc/c-api/long.rst

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
Sergey B Kirpichev 2024-08-17 12:13:31 +03:00 committed by GitHub
parent e9287ea426
commit ce4b9c8464
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,9 +94,9 @@ 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` .. seealso:: :c:func:`PyLong_AsNativeBytes()` and
to convert a :c:type:`PyLongObject` to/from an array of bytes in base :c:func:`PyLong_FromNativeBytes()` functions can be used to convert
``256``. You can call those from C using :c:func:`PyObject_CallMethod`. a :c:type:`PyLongObject` to/from an array of bytes in base ``256``.
.. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base) .. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)