]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH...
authorYashraj <yashrajpala8@gmail.com>
Mon, 12 Jan 2026 12:59:59 +0000 (18:29 +0530)
committerGitHub <noreply@github.com>
Mon, 12 Jan 2026 12:59:59 +0000 (13:59 +0100)
Doc/c-api/unicode.rst
Tools/check-c-api-docs/ignored_c_api.txt

index ca7c8bb11a5d78adcc7cc1c641cb4e49cd9e4058..d2b6643c700e88d0247b2b8b7ce746e63b020a2a 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 31c920555992bb388d861b954230609ae1a55fc6..ebc0b5a8710ab57457fafe2f3efefedcba927dcd 100644 (file)
@@ -101,9 +101,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
@@ -139,4 +136,4 @@ PY_MONITORING_EVENT_BRANCH
 PY_DEF_EVENT
 PY_FOREACH_DICT_EVENT
 # cpython/pystats.h
-PYSTATS_MAX_UOP_ID
+PYSTATS_MAX_UOP_ID
\ No newline at end of file