Skip to content

Commit 1932127

Browse files
encukouvstinner
andauthored
gh-141004: Document remaining constants from patchlevel.h (GH-143598)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 499d3a8 commit 1932127

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

Doc/c-api/apiabiversion.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ See :ref:`stable` for a discussion of API and ABI stability across versions.
3434
This can be ``0xA`` for alpha, ``0xB`` for beta, ``0xC`` for release
3535
candidate or ``0xF`` for final.
3636

37+
38+
.. c:namespace:: NULL
39+
.. c:macro:: PY_RELEASE_LEVEL_ALPHA
40+
:no-typesetting:
41+
.. c:macro:: PY_RELEASE_LEVEL_BETA
42+
:no-typesetting:
43+
.. c:macro:: PY_RELEASE_LEVEL_GAMMA
44+
:no-typesetting:
45+
.. c:macro:: PY_RELEASE_LEVEL_FINAL
46+
:no-typesetting:
47+
48+
For completeness, the values are available as macros:
49+
:c:macro:`!PY_RELEASE_LEVEL_ALPHA` (``0xA``),
50+
:c:macro:`!PY_RELEASE_LEVEL_BETA` (``0xB``),
51+
:c:macro:`!PY_RELEASE_LEVEL_GAMMA` (``0xC``), and
52+
:c:macro:`!PY_RELEASE_LEVEL_FINAL` (``0xF``).
53+
3754
.. c:macro:: PY_RELEASE_SERIAL
3855
3956
The ``2`` in ``3.4.1a2``. Zero for final releases.
@@ -46,6 +63,10 @@ See :ref:`stable` for a discussion of API and ABI stability across versions.
4663
Use this for numeric comparisons, for example,
4764
``#if PY_VERSION_HEX >= ...``.
4865

66+
.. c:macro:: PY_VERSION
67+
68+
The Python version as a string, for example, ``"3.4.1a2"``.
69+
4970

5071
Run-time version
5172
----------------

Doc/c-api/module.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,18 @@ struct:
820820
.. versionadded:: 3.5
821821
822822
.. c:macro:: PYTHON_API_VERSION
823+
PYTHON_API_STRING
823824
824-
The C API version. Defined for backwards compatibility.
825+
The C API version, as an integer (``1013``) and string (``"1013"``), respectively.
826+
Defined for backwards compatibility.
825827
826828
Currently, this constant is not updated in new Python versions, and is not
827829
useful for versioning. This may change in the future.
828830
829831
.. c:macro:: PYTHON_ABI_VERSION
832+
PYTHON_ABI_STRING
830833
831-
Defined as ``3`` for backwards compatibility.
834+
Defined as ``3`` and ``"3"``, respectively, for backwards compatibility.
832835
833836
Currently, this constant is not updated in new Python versions, and is not
834837
useful for versioning. This may change in the future.

Tools/check-c-api-docs/ignored_c_api.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ PY_SIZE_MAX
5858
PY_UINT32_T
5959
PY_UINT64_T
6060
PY_ULLONG_MAX
61-
# patchlevel.h
62-
PYTHON_ABI_STRING
63-
PYTHON_API_STRING
64-
PY_RELEASE_LEVEL_ALPHA
65-
PY_RELEASE_LEVEL_BETA
66-
PY_RELEASE_LEVEL_FINAL
67-
PY_RELEASE_LEVEL_GAMMA
68-
PY_VERSION
6961
# unicodeobject.h
7062
Py_UNICODE_SIZE
7163
# cpython/methodobject.h

0 commit comments

Comments
 (0)