blob: b32c113e5f04573a04fd53f20c267cbd79897079 [file] [log] [blame]
Stéphane Wirtelcbb64842019-05-17 11:55:34 +02001.. highlight:: c
Georg Brandl54a3faa2008-01-20 09:30:57 +00002
3.. _descriptor-objects:
4
5Descriptor Objects
6------------------
7
8"Descriptors" are objects that describe some attribute of an object. They are
9found in the dictionary of type objects.
10
11.. XXX document these!
12
Georg Brandl60203b42010-10-06 10:11:56 +000013.. c:var:: PyTypeObject PyProperty_Type
Georg Brandl54a3faa2008-01-20 09:30:57 +000014
15 The type object for the built-in descriptor types.
16
17
Georg Brandl60203b42010-10-06 10:11:56 +000018.. c:function:: PyObject* PyDescr_NewGetSet(PyTypeObject *type, struct PyGetSetDef *getset)
Georg Brandl54a3faa2008-01-20 09:30:57 +000019
20
Georg Brandl60203b42010-10-06 10:11:56 +000021.. c:function:: PyObject* PyDescr_NewMember(PyTypeObject *type, struct PyMemberDef *meth)
Georg Brandl54a3faa2008-01-20 09:30:57 +000022
23
Georg Brandl60203b42010-10-06 10:11:56 +000024.. c:function:: PyObject* PyDescr_NewMethod(PyTypeObject *type, struct PyMethodDef *meth)
Georg Brandl54a3faa2008-01-20 09:30:57 +000025
26
Georg Brandl60203b42010-10-06 10:11:56 +000027.. c:function:: PyObject* PyDescr_NewWrapper(PyTypeObject *type, struct wrapperbase *wrapper, void *wrapped)
Georg Brandl54a3faa2008-01-20 09:30:57 +000028
29
Georg Brandl60203b42010-10-06 10:11:56 +000030.. c:function:: PyObject* PyDescr_NewClassMethod(PyTypeObject *type, PyMethodDef *method)
Georg Brandl54a3faa2008-01-20 09:30:57 +000031
32
Georg Brandl60203b42010-10-06 10:11:56 +000033.. c:function:: int PyDescr_IsData(PyObject *descr)
Georg Brandl54a3faa2008-01-20 09:30:57 +000034
Erlend Egeberg Aasland871eb422021-02-16 08:50:00 +010035 Return non-zero if the descriptor objects *descr* describes a data attribute, or
36 ``0`` if it describes a method. *descr* must be a descriptor object; there is
Georg Brandl54a3faa2008-01-20 09:30:57 +000037 no error checking.
38
39
Georg Brandl60203b42010-10-06 10:11:56 +000040.. c:function:: PyObject* PyWrapper_New(PyObject *, PyObject *)