https://github.com/python/cpython/commit/f14744f43160c0733333c451382bedc57470f5eb
commit: f14744f43160c0733333c451382bedc57470f5eb
branch: 3.14
author: Peter Bierma <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2026-10-19T22:17:31Z
summary:
[3.14] gh-141004: Document missing `pyport.h` macros (GH-159719) (GH-159796)
(cherry picked from commit 4c34b7ebf15d4775323936278ab6ee9900671fa7)
files:
M Doc/c-api/float.rst
M Doc/c-api/intro.rst
M Doc/tools/.nitignore
M Tools/check-c-api-docs/ignored_c_api.txt
diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst
index 420f7f9401fcc4c..3c8470f94d89493 100644
--- a/Doc/c-api/float.rst
+++ b/Doc/c-api/float.rst
@@ -210,9 +210,9 @@ Pack functions
The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an
:c:expr:`int` argument, non-zero if you want the bytes string in little-endian
format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if
you
-want big-endian format (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN`
-constant can be used to use the native endian: it is equal to ``1`` on big
-endian processor, or ``0`` on little endian processor.
+want big-endian format (exponent first, at *p*). Use the
:c:macro:`PY_LITTLE_ENDIAN`
+constant to select the native endian: it is equal to ``0`` on big
+endian processor, or ``1`` on little endian processor.
Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set,
most likely :exc:`OverflowError`).
@@ -241,8 +241,8 @@ Unpack functions
The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an
:c:expr:`int` argument, non-zero if the bytes string is in little-endian format
(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-endian
-(exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can be used to
-use the native endian: it is equal to ``1`` on big endian processor, or ``0``
+(exponent first, at *p*). Use the :c:macro:`PY_LITTLE_ENDIAN` constant to
+select the native endian: it is equal to ``0`` on big endian processor, or
``1``
on little endian processor.
Return value: The unpacked double. On error, this is ``-1.0`` and
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst
index fd025999db9d9c2..4100460feb74830 100644
--- a/Doc/c-api/intro.rst
+++ b/Doc/c-api/intro.rst
@@ -259,6 +259,12 @@ Numeric utilities
Argument must be a character or an integer in the range [-128, 127] or [0,
255]. This macro returns ``c`` cast to an ``unsigned char``.
+.. c:macro:: PY_BIG_ENDIAN
+ PY_LITTLE_ENDIAN
+
+ Constants describing the byte order of the platform that Python was built
+ for. Exactly one of them is ``1`` and the other is ``0``.
+
Assertion utilities
^^^^^^^^^^^^^^^^^^^
@@ -820,8 +826,13 @@ use them.
A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``.
C99 doesn't define such a thing directly (size_t is an unsigned integral
type).
- See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest positive value
- of type :c:type:`Py_ssize_t`.
+ See :pep:`353` for details.
+
+.. c:macro:: PY_SSIZE_T_MAX
+ PY_SSIZE_T_MIN
+
+ The limit values (largest positive one and smallest negative one,
+ respecitvely) of type :c:type:`Py_ssize_t`.
.. _api-exceptions:
diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore
index 882914297fa6742..9643fd6b9d44d4c 100644
--- a/Doc/tools/.nitignore
+++ b/Doc/tools/.nitignore
@@ -2,7 +2,6 @@
# as tested on the CI via check-warnings.py in reusable-docs.yml.
# Keep lines sorted lexicographically to help avoid merge conflicts.
-Doc/c-api/float.rst
Doc/c-api/module.rst
Doc/library/ast.rst
Doc/library/asyncio-extending.rst
diff --git a/Tools/check-c-api-docs/ignored_c_api.txt
b/Tools/check-c-api-docs/ignored_c_api.txt
index 55d72b8574825ac..b875ad066e00896 100644
--- a/Tools/check-c-api-docs/ignored_c_api.txt
+++ b/Tools/check-c-api-docs/ignored_c_api.txt
@@ -31,7 +31,6 @@ PY_DWORD_MAX
PY_FORMAT_SIZE_T
PY_INT32_T
PY_INT64_T
-PY_LITTLE_ENDIAN
PY_LLONG_MAX
PY_LLONG_MIN
PY_LONG_LONG
_______________________________________________
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]