Skip to content

Commit 807db68

Browse files
gh-141004: Document PyClassMethod* and PyStaticMethod* APIs (GH-141296)
1 parent 18529b5 commit 807db68

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Doc/c-api/descriptor.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,39 @@ found in the dictionary of type objects.
3838
3939
4040
.. c:function:: PyObject* PyWrapper_New(PyObject *, PyObject *)
41+
42+
43+
Built-in descriptors
44+
^^^^^^^^^^^^^^^^^^^^
45+
46+
.. c:var:: PyTypeObject PyClassMethod_Type
47+
48+
The type of class method objects. This is the same object as
49+
:class:`classmethod` in the Python layer.
50+
51+
52+
.. c:function:: PyObject *PyClassMethod_New(PyObject *callable)
53+
54+
Create a new :class:`classmethod` object wrapping *callable*.
55+
*callable* must be a callable object and must not be ``NULL``.
56+
57+
On success, this function returns a :term:`strong reference` to a new class
58+
method descriptor. On failure, this function returns ``NULL`` with an
59+
exception set.
60+
61+
62+
.. c:var:: PyTypeObject PyStaticMethod_Type
63+
64+
The type of static method objects. This is the same object as
65+
:class:`staticmethod` in the Python layer.
66+
67+
68+
.. c:function:: PyObject *PyStaticMethod_New(PyObject *callable)
69+
70+
Create a new :class:`staticmethod` object wrapping *callable*.
71+
*callable* must be a callable object and must not be ``NULL``.
72+
73+
On success, this function returns a :term:`strong reference` to a new static
74+
method descriptor. On failure, this function returns ``NULL`` with an
75+
exception set.
76+

0 commit comments

Comments
 (0)