https://github.com/python/cpython/commit/b744fa5d3ec2294f3ef94733b728481807ca3039
commit: b744fa5d3ec2294f3ef94733b728481807ca3039
branch: main
author: Gregory P. Smith <[email protected]>
committer: gpshead <[email protected]>
date: 2024-05-05T21:43:42Z
summary:
gh-111140: minor docs typos cleanup in the C example API calls. (#118612)
files:
M Doc/c-api/long.rst
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index 1eb8f191c3ca32..522c028cfb8d40 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -390,7 +390,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred`
to disambiguate.
Usage example::
int32_t value;
- Py_ssize_t bytes = PyLong_AsNativeBits(pylong, &value, sizeof(value),
-1);
+ Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value),
-1);
if (bytes < 0) {
// Failed. A Python exception was set with the reason.
return NULL;
@@ -418,7 +418,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred`
to disambiguate.
called twice: first to determine the buffer size, then to fill it::
// Ask how much space we need.
- Py_ssize_t expected = PyLong_AsNativeBits(pylong, NULL, 0, -1);
+ Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);
if (expected < 0) {
// Failed. A Python exception was set with the reason.
return NULL;
@@ -430,7 +430,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred`
to disambiguate.
return NULL;
}
// Safely get the entire value.
- Py_ssize_t bytes = PyLong_AsNativeBits(pylong, bignum, expected, -1);
+ Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, bignum, expected, -1);
if (bytes < 0) { // Exception has been set.
free(bignum);
return NULL;
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]