Pelokalan
Python ID
id en
Masuk
Proyek
c-api__descriptor.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
Descriptor Objects
Obyek Deskriptor
"Descriptors" are objects that describe some attribute of an object. They are found in the dictionary of type objects.
"Deskriptor" adalah obyek yang menggambarkan beberapa atribut dari suatu obyek. Hal tersebut ditemukan dalam kamus jenis obyek.
The type object for member descriptor objects created from :c:type:`PyMemberDef` structures. These descriptors expose fields of a C struct as attributes on a type, and correspond to :class:`types.MemberDescriptorType` objects in Python.
The type object for get/set descriptor objects created from :c:type:`PyGetSetDef` structures. These descriptors implement attributes whose value is computed by C getter and setter functions, and are used for many built-in type attributes. They correspond to :class:`types.GetSetDescriptorType` objects in Python.
The type object for method descriptor objects created from :c:type:`PyMethodDef` structures. These descriptors expose C functions as methods on a type, and correspond to :class:`types.MethodDescriptorType` objects in Python.
The type object for wrapper descriptor objects created by :c:func:`PyDescr_NewWrapper` and :c:func:`PyWrapper_New`.
This is the bound form of a wrapper descriptor created by :c:func:`PyDescr_NewWrapper`. CPython creates these objects when a slot wrapper is accessed through an instance, and they appear in Python as :class:`types.MethodWrapperType` objects.
This was included in Python's C API by mistake; do not use it in extensions. For creating custom descriptor objects, create a class implementing the descriptor protocol (:c:member:`~PyTypeObject.tp_descr_get` and :c:member:`~PyTypeObject.tp_descr_set`).
The type object for property objects. This is the same object as :class:`property` in the Python layer.
The type object for super objects. This is the same object as :class:`super` in the Python layer.
The type of class method objects. This is the same object as :class:`classmethod` in the Python layer.
The type object for C-level class method descriptor objects. This is the type of the descriptors created for :func:`classmethod` defined in C extension types, and corresponds to :class:`types.ClassMethodDescriptorType` objects in Python.
The type of static method objects. This is the same object as :class:`staticmethod` in the Python layer.