Issue #10771: Clarify that descriptors get used in an *owner* class or one of its parents.

This commit is contained in:
Raymond Hettinger 2011-03-22 16:27:31 -07:00
commit 2052978e9a

View File

@ -1352,10 +1352,11 @@ Implementing Descriptors
^^^^^^^^^^^^^^^^^^^^^^^^
The following methods only apply when an instance of the class containing the
method (a so-called *descriptor* class) appears in the class dictionary of
another class, known as the *owner* class. In the examples below, "the
attribute" refers to the attribute whose name is the key of the property in the
owner class' :attr:`__dict__`.
method (a so-called *descriptor* class) appears in an *owner* class (the
descriptor must be in either the owner's class dictionary or in the class
dictionary for one of its parents). In the examples below, "the attribute"
refers to the attribute whose name is the key of the property in the owner
class' :attr:`__dict__`.
.. method:: object.__get__(self, instance, owner)