]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: Document `PyExceptionClass` functions in the C API (GH-135697)
authorYuki Kobayashi <drsuaimqjgar@gmail.com>
Fri, 20 Jun 2025 13:57:04 +0000 (22:57 +0900)
committerGitHub <noreply@github.com>
Fri, 20 Jun 2025 13:57:04 +0000 (09:57 -0400)
* Docs: Document `PyExceptionClass_Name`

`PyExceptionClass_Name` is an undocumented function in the limited API.

* Document `PyExceptionClass_Check`

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
 =================