@@ -1618,21 +1618,32 @@ refers to the attribute whose name is the key of the property in the owner
16181618class' :attr: `~object.__dict__ `.
16191619
16201620
1621- .. method :: object.__get__(self, instance, owner)
1621+ .. method :: object.__get__(self, instance, owner=None )
16221622
1623- Called to get the attribute of the owner class (class attribute access) or of an
1624- instance of that class (instance attribute access). *owner * is always the owner
1625- class, while *instance * is the instance that the attribute was accessed through,
1626- or ``None `` when the attribute is accessed through the *owner *. This method
1627- should return the (computed) attribute value or raise an :exc: `AttributeError `
1628- exception.
1623+ Called to get the attribute of the owner class (class attribute access) or
1624+ of an instance of that class (instance attribute access). The optional
1625+ *owner * argument is the owner class, while *instance * is the instance that
1626+ the attribute was accessed through, or ``None `` when the attribute is
1627+ accessed through the *owner *.
16291628
1629+ This method should return the computed attribute value or raise an
1630+ :exc: `AttributeError ` exception.
1631+
1632+ :PEP: `252 ` specifies that :meth: `__get__ ` is callable with one or two
1633+ arguments. Python's own built-in descriptors support this specification;
1634+ however, it is likely that some third-party tools have descriptors
1635+ that require both arguments. Python's own :meth: `__getattribute__ `
1636+ implementation always passes in both arguments whether they are required
1637+ or not.
16301638
16311639.. method :: object.__set__(self, instance, value)
16321640
16331641 Called to set the attribute on an instance *instance * of the owner class to a
16341642 new value, *value *.
16351643
1644+ Note, adding :meth: `__set__ ` or :meth: `__delete__ ` changes the kind of
1645+ descriptor to a "data descriptor". See :ref: `descriptor-invocation ` for
1646+ more details.
16361647
16371648.. method :: object.__delete__(self, instance)
16381649
0 commit comments