]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString() (#121478)
authorSergey B Kirpichev <skirpichev@gmail.com>
Sat, 17 Aug 2024 09:13:31 +0000 (12:13 +0300)
committerGitHub <noreply@github.com>
Sat, 17 Aug 2024 09:13:31 +0000 (09:13 +0000)
* gh-121477: mention new PyLong_*Bytes() functions in PyLong_FromString()

* Update Doc/c-api/long.rst

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Doc/c-api/long.rst

index 9f2c48d98b83449787f58fdf675b8d348bab3ea3..c7c6fe9f942bd890d909da74c1192dfcb8c55ae8 100644 (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
    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`.
+   .. seealso:: :c:func:`PyLong_AsNativeBytes()` and
+      :c:func:`PyLong_FromNativeBytes()` functions can be used to convert
+      a :c:type:`PyLongObject` to/from an array of bytes in base ``256``.
 
 
 .. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)