]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-141004: Document `PyExceptionInstance*` APIs (GH-141301) (GH-141302)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 9 Nov 2025 17:20:24 +0000 (18:20 +0100)
committerGitHub <noreply@github.com>
Sun, 9 Nov 2025 17:20:24 +0000 (12:20 -0500)
gh-141004: Document `PyExceptionInstance*` APIs (GH-141301)
(cherry picked from commit b5a0c72492800c7e999b87adfcfeabaacb4ecb97)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/c-api/exceptions.rst

index c58aa659e1b1b4608a17251429a23761b4a5ce0c..5241533e11281f195dec12a574b14db57cc77e3c 100644 (file)
@@ -788,6 +788,17 @@ Exception Classes
 Exception Objects
 =================
 
+.. c:function:: int PyExceptionInstance_Check(PyObject *op)
+
+   Return true if *op* is an instance of :class:`BaseException`, false
+   otherwise. This function always succeeds.
+
+
+.. c:macro:: PyExceptionInstance_Class(op)
+
+   Equivalent to :c:func:`Py_TYPE(op) <Py_TYPE>`.
+
+
 .. c:function:: PyObject* PyException_GetTraceback(PyObject *ex)
 
    Return the traceback associated with the exception as a new reference, as