blob: 43baeaf1009b30eb00302dbf916fa84c3785ed60 [file] [log] [blame]
Georg Brandlf6842722008-01-19 22:08:21 +00001.. highlightlang:: c
2
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
Sandro Tosi98ed08f2012-01-14 16:42:02 +010012.. c:var:: PyTypeObject PyProperty_Type
Georg Brandlf6842722008-01-19 22:08:21 +000013
14 The type object for the built-in descriptor types.
15
16 .. versionadded:: 2.2
17
18
Sandro Tosi98ed08f2012-01-14 16:42:02 +010019.. c:function:: PyObject* PyDescr_NewGetSet(PyTypeObject *type, struct PyGetSetDef *getset)
Georg Brandlf6842722008-01-19 22:08:21 +000020
21 .. versionadded:: 2.2
22
23
Sandro Tosi98ed08f2012-01-14 16:42:02 +010024.. c:function:: PyObject* PyDescr_NewMember(PyTypeObject *type, struct PyMemberDef *meth)
Georg Brandlf6842722008-01-19 22:08:21 +000025
26 .. versionadded:: 2.2
27
28
Sandro Tosi98ed08f2012-01-14 16:42:02 +010029.. c:function:: PyObject* PyDescr_NewMethod(PyTypeObject *type, struct PyMethodDef *meth)
Georg Brandlf6842722008-01-19 22:08:21 +000030
31 .. versionadded:: 2.2
32
33
Sandro Tosi98ed08f2012-01-14 16:42:02 +010034.. c:function:: PyObject* PyDescr_NewWrapper(PyTypeObject *type, struct wrapperbase *wrapper, void *wrapped)
Georg Brandlf6842722008-01-19 22:08:21 +000035
36 .. versionadded:: 2.2
37
38
Sandro Tosi98ed08f2012-01-14 16:42:02 +010039.. c:function:: PyObject* PyDescr_NewClassMethod(PyTypeObject *type, PyMethodDef *method)
Georg Brandlf6842722008-01-19 22:08:21 +000040
41 .. versionadded:: 2.3
42
43
Sandro Tosi98ed08f2012-01-14 16:42:02 +010044.. c:function:: int PyDescr_IsData(PyObject *descr)
Georg Brandlf6842722008-01-19 22:08:21 +000045
46 Return true if the descriptor objects *descr* describes a data attribute, or
47 false if it describes a method. *descr* must be a descriptor object; there is
48 no error checking.
49
50 .. versionadded:: 2.2
51
52
Sandro Tosi98ed08f2012-01-14 16:42:02 +010053.. c:function:: PyObject* PyWrapper_New(PyObject *, PyObject *)
Georg Brandlf6842722008-01-19 22:08:21 +000054
55 .. versionadded:: 2.2