Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b654be

Browse files
committed
Issue #10771: Clarify that descriptors get used in an *owner* class or one of its parents.
1 parent a8e4d6e commit 3b654be

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Doc/reference/datamodel.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,10 +1353,11 @@ Implementing Descriptors
13531353
^^^^^^^^^^^^^^^^^^^^^^^^
13541354

13551355
The following methods only apply when an instance of the class containing the
1356-
method (a so-called *descriptor* class) appears in the class dictionary of
1357-
another class, known as the *owner* class. In the examples below, "the
1358-
attribute" refers to the attribute whose name is the key of the property in the
1359-
owner class' :attr:`__dict__`.
1356+
method (a so-called *descriptor* class) appears in an *owner* class (the
1357+
descriptor must be in either the owner's class dictionary or in the class
1358+
dictionary for one of its parents). In the examples below, "the attribute"
1359+
refers to the attribute whose name is the key of the property in the owner
1360+
class' :attr:`__dict__`.
13601361

13611362

13621363
.. method:: object.__get__(self, instance, owner)

0 commit comments

Comments
 (0)