Документация Python неофициальный перевод

descriptor.md

50 строк · 3.4 КБ · обычная страница · сырой текст · скачать

1> **Источник:** https://python-all.ru/3.0/c-api/descriptor.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Объекты дескрипторов89«Дескрипторы» – это объекты, описывающие некоторый атрибут объекта. Они находятся в словаре объектов типов.1011**\[PyProperty\_Type\][PyTypeObject](https://python-all.ru/3.0/c-api/type.html#PyTypeObject) `PyProperty_Type`**1213Объект типа для встроенных типов дескрипторов.1415**\[PyDescr\_NewGetSet\][PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject)\* `PyDescr_NewGetSet`([PyTypeObject](https://python-all.ru/3.0/c-api/type.html#PyTypeObject) *\*type*, struct PyGetSetDef *\*getset*)**1617*Возвращаемое значение: новая ссылка.*1819**\[PyDescr\_NewMember\][PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject)\* `PyDescr_NewMember`([PyTypeObject](https://python-all.ru/3.0/c-api/type.html#PyTypeObject) *\*type*, struct [PyMemberDef](https://python-all.ru/3.0/c-api/structures.html#PyMemberDef) *\*meth*)**2021*Возвращаемое значение: новая ссылка.*2223**\[PyDescr\_NewMethod\][PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject)\* `PyDescr_NewMethod`([PyTypeObject](https://python-all.ru/3.0/c-api/type.html#PyTypeObject) *\*type*, struct [PyMethodDef](https://python-all.ru/3.0/c-api/structures.html#PyMethodDef) *\*meth*)**2425*Возвращаемое значение: новая ссылка.*2627**\[PyDescr\_NewWrapper\][PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject)\* `PyDescr_NewWrapper`([PyTypeObject](https://python-all.ru/3.0/c-api/type.html#PyTypeObject) *\*type*, struct wrapperbase *\*wrapper*, void *\*wrapped*)**2829*Возвращаемое значение: новая ссылка.*3031**\[PyDescr\_NewClassMethod\][PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject)\* `PyDescr_NewClassMethod`([PyTypeObject](https://python-all.ru/3.0/c-api/type.html#PyTypeObject) *\*type*, [PyMethodDef](https://python-all.ru/3.0/c-api/structures.html#PyMethodDef) *\*method*)**3233*Возвращаемое значение: новая ссылка.*3435**\[PyDescr\_IsData\]int `PyDescr_IsData`([PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject) *\*descr*)**3637Возвращает true, если объект-дескриптор3839*descr*4041описывает атрибут данных, или false, если описывает метод.4243*descr*4445должен быть объектом-дескриптором; проверка ошибок не выполняется.4647**\[PyWrapper\_New\][PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject)\* `PyWrapper_New`([PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject) *\**, [PyObject](https://python-all.ru/3.0/c-api/structures.html#PyObject) *\**)**4849*Возвращаемое значение: новая ссылка.*50