From 03cc729b879656161f8ff68b808612a942900480 Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Fri, 20 Jun 2025 22:57:04 +0900 Subject: [PATCH] Docs: Document `PyExceptionClass` functions in the C API (GH-135697) * Docs: Document `PyExceptionClass_Name` `PyExceptionClass_Name` is an undocumented function in the limited API. * Document `PyExceptionClass_Check` (cherry picked from commit 59963e866a1bb8128a50cd53d1b13eeab03df06e) Co-authored-by: Yuki Kobayashi --- Doc/c-api/exceptions.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index bb1339db140fb2..e7ae464b8918d8 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -749,6 +749,16 @@ Exception Classes .. versionadded:: 3.2 +.. c:function:: int PyExceptionClass_Check(PyObject *ob) + + Return non-zero if *ob* is an exception class, zero otherwise. This function always succeeds. + + +.. c:function:: const char *PyExceptionClass_Name(PyObject *ob) + + Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*. + + Exception Objects =================