https://github.com/python/cpython/commit/42f7c2dfba58a8a8f31aba727d0fc51dd3ce2fce
commit: 42f7c2dfba58a8a8f31aba727d0fc51dd3ce2fce
branch: main
author: Yashraj <[email protected]>
committer: encukou <[email protected]>
date: 2026-01-12T13:59:59+01:00
summary:
gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros
(GH-143494)
files:
M Doc/c-api/unicode.rst
M Tools/check-c-api-docs/ignored_c_api.txt
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index ca7c8bb11a5d78..d2b6643c700e88 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -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:
diff --git a/Tools/check-c-api-docs/ignored_c_api.txt
b/Tools/check-c-api-docs/ignored_c_api.txt
index 31c920555992bb..ebc0b5a8710ab5 100644
--- a/Tools/check-c-api-docs/ignored_c_api.txt
+++ b/Tools/check-c-api-docs/ignored_c_api.txt
@@ -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
_______________________________________________
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]