]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros...
authorPetr Viktorin <encukou@gmail.com>
Tue, 13 Jan 2026 18:06:23 +0000 (19:06 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Jan 2026 18:06:23 +0000 (19:06 +0100)
(cherry picked from commit 42f7c2dfba58a8a8f31aba727d0fc51dd3ce2fce)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Doc/c-api/unicode.rst
Tools/check-c-api-docs/ignored_c_api.txt

index 9fa88915c3c02347a100ead61325b922104c1a29..b7d3aaf3227bf0d998f2224f559a189e0c925414 100644 (file)
@@ -65,6 +65,27 @@ Python:
    .. versionadded:: 3.3
 
 
+   The structure of a particular object can be determined using the following
+   macros.
+   The macros cannot fail; their behavior is undefined if their argument
+   is not a Python Unicode object.
+
+   .. c:namespace:: NULL
+
+   .. c:macro:: PyUnicode_IS_COMPACT(o)
+
+      True if *o* uses the :c:struct:`PyCompactUnicodeObject` structure.
+
+      .. versionadded:: 3.3
+
+
+   .. c:macro:: PyUnicode_IS_COMPACT_ASCII(o)
+
+      True if *o* uses the :c:struct:`PyASCIIObject` structure.
+
+      .. versionadded:: 3.3
+
+
 The following APIs are C macros and static inlined functions for fast checks and
 access to internal read-only data of Unicode objects:
 
index 5c96e34b0b21871b7fb0f077f0f7a6b4c08528b4..e73e235d6c6d6f906b6074e4d08cf50d058365a5 100644 (file)
@@ -109,9 +109,6 @@ PyUnstable_EXECUTABLE_KIND_PY_FUNCTION
 PyUnstable_EXECUTABLE_KIND_SKIP
 # cpython/pylifecycle.h
 Py_FrozenMain
-# cpython/unicodeobject.h
-PyUnicode_IS_COMPACT
-PyUnicode_IS_COMPACT_ASCII
 # pythonrun.h
 PyErr_Display
 # cpython/objimpl.h