]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Docs: Document `PyExceptionClass` functions in the C API (GH-135697) (GH-135757)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 20 Jun 2025 14:03:46 +0000 (16:03 +0200)
committerGitHub <noreply@github.com>
Fri, 20 Jun 2025 14:03:46 +0000 (14:03 +0000)
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 <drsuaimqjgar@gmail.com>
Doc/c-api/exceptions.rst

index 885dbeb75303d15e349795a997ddcc11eff9005c..a750cda3e2d474e7c3c716a168fcd5472c42bfc4 100644 (file)
@@ -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
 =================