diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 0ee595a07acc77..ccc8a1f38aebaf 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -868,6 +868,22 @@ Exception Objects .. versionadded:: 3.12 +.. c:macro:: PyException_HEAD + + This is a macro used when declaring new exception types. + The :c:macro:`!PyException_HEAD` macro expands to:: + + PyObject_HEAD + PyObject *dict; + PyObject *args; + PyObject *notes; + PyObject *traceback; + PyObject *context; + PyObject *cause; + char suppress_context; + + See :c:macro:`PyObject_HEAD` for the base object header. + .. _unicodeexceptions: Unicode Exception Objects diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 58dd915e04f619..4ad0876a7317e0 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -79,7 +79,7 @@ under :ref:`reference counting `. .. c:macro:: PyObject_HEAD This is a macro used when declaring new types which represent objects - without a varying length. The PyObject_HEAD macro expands to:: + without a varying length. The :c:macro:`!PyObject_HEAD` macro expands to:: PyObject ob_base; @@ -90,7 +90,7 @@ under :ref:`reference counting `. This is a macro used when declaring new types which represent objects with a length that varies from instance to instance. - The PyObject_VAR_HEAD macro expands to:: + The :c:macro:`!PyObject_VAR_HEAD` macro expands to:: PyVarObject ob_base;