描述符对象
描述符对象
“描述符”是描述对象的某些属性的对象。它们存在于类型对象的字典中。
PyTypeObject PyProperty_Type
属于稳定 ABI.
内建描述符类型的类型对象。
PyObject PyDescr_NewGetSet(PyTypeObject type, struct PyGetSetDef *getset)
返回值:新的引用。 属于稳定 ABI.
PyObject PyDescr_NewMember(PyTypeObject type, struct PyMemberDef *meth)
返回值:新的引用。 属于稳定 ABI.
PyObject PyDescr_NewMethod(PyTypeObject type, struct PyMethodDef *meth)
返回值:新的引用。 属于稳定 ABI.
PyObject PyDescr_NewWrapper(PyTypeObject type, struct wrapperbase wrapper, void wrapped)
返回值:新的引用。
PyObject PyDescr_NewClassMethod(PyTypeObject type, PyMethodDef *method)
返回值:新的引用。 属于稳定 ABI.
int PyDescr_IsData(PyObject *descr)
如果描述符对象 descr 描述的是一个数据属性则返回非零值,或者如果它描述的是一个方法则返回 0。 descr 必须为一个描述符对象;不会进行错误检测。
PyObject PyWrapper_New(PyObject, PyObject*)
返回值:新的引用。 属于稳定 ABI.
