Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Document PyException_HEAD
  • Loading branch information
ZeroIntensity committed Jan 16, 2026
commit 65d6ced9e68523a549e74d806021fa503ac7e9a9
11 changes: 11 additions & 0 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,17 @@ Exception Classes
Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*.


.. c:macro:: PyException_HEAD

This is a :term:`soft deprecated` macro including the base fields for an
exception object.

This was included in Python's C API by mistake and is not designed for use
in extensions. For creating custom exception objects, use
:c:func:`PyErr_NewException` or otherwise create a class inheriting from
:c:data:`PyExc_BaseException`.


Exception Objects
=================

Expand Down