Skip to content

Commit 42f7c2d

Browse files
authored
gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH-143494)
1 parent 7f50a5f commit 42f7c2d

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

Doc/c-api/unicode.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,27 @@ Python:
6565
.. versionadded:: 3.3
6666

6767

68+
The structure of a particular object can be determined using the following
69+
macros.
70+
The macros cannot fail; their behavior is undefined if their argument
71+
is not a Python Unicode object.
72+
73+
.. c:namespace:: NULL
74+
75+
.. c:macro:: PyUnicode_IS_COMPACT(o)
76+
77+
True if *o* uses the :c:struct:`PyCompactUnicodeObject` structure.
78+
79+
.. versionadded:: 3.3
80+
81+
82+
.. c:macro:: PyUnicode_IS_COMPACT_ASCII(o)
83+
84+
True if *o* uses the :c:struct:`PyASCIIObject` structure.
85+
86+
.. versionadded:: 3.3
87+
88+
6889
The following APIs are C macros and static inlined functions for fast checks and
6990
access to internal read-only data of Unicode objects:
7091

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ PyUnstable_EXECUTABLE_KIND_PY_FUNCTION
101101
PyUnstable_EXECUTABLE_KIND_SKIP
102102
# cpython/pylifecycle.h
103103
Py_FrozenMain
104-
# cpython/unicodeobject.h
105-
PyUnicode_IS_COMPACT
106-
PyUnicode_IS_COMPACT_ASCII
107104
# pythonrun.h
108105
PyErr_Display
109106
# cpython/objimpl.h
@@ -139,4 +136,4 @@ PY_MONITORING_EVENT_BRANCH
139136
PY_DEF_EVENT
140137
PY_FOREACH_DICT_EVENT
141138
# cpython/pystats.h
142-
PYSTATS_MAX_UOP_ID
139+
PYSTATS_MAX_UOP_ID

0 commit comments

Comments
 (0)