• Home
  • Raw
  • Download

Lines Matching full:descriptors

13 Defines descriptors, summarizes the protocol, and shows how descriptors are
14 called. Examines a custom descriptor and several built-in python descriptors
18 Learning about descriptors not only provides access to a larger toolset, it
39 were defined. Note that descriptors are only invoked for new style objects or
43 Descriptors are a powerful, general purpose protocol. They are the mechanism
46 introduced in version 2.2. Descriptors simplify the underlying C-code and offer
64 a data descriptor. Descriptors that only define :meth:`__get__` are called
65 non-data descriptors (they are typically used for methods but other uses are
68 Data and non-data descriptors differ in how overrides are calculated with
80 Invoking Descriptors
92 Either way, descriptors only work for new style objects and classes. A class is
97 implementation works through a precedence chain that gives data descriptors
99 descriptors, and assigns lowest priority to :meth:`__getattr__` if provided.
116 * descriptors are invoked by the :meth:`__getattribute__` method
121 * data descriptors always override instance dictionaries.
122 * non-data descriptors may be overridden by instance dictionaries.
125 method for invoking descriptors. The call ``super(B, obj).m()`` searches
132 ``m`` was a data descriptor. In Python 2.3, non-data descriptors also get
138 The details above show that the mechanism for descriptors is embedded in the
149 The following code creates a class whose objects are data descriptors which
272 Using non-data descriptors, the two are merged seamlessly.
283 non-data descriptors which return bound or unbound methods depending whether
324 Non-data descriptors provide a simple mechanism for variations on the usual