Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ under :ref:`reference counting <countingrefs>`.
.. 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;

Expand All @@ -90,7 +90,7 @@ under :ref:`reference counting <countingrefs>`.

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;

Expand Down
Loading