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

Skip to content

Commit 2052978

Browse files
committed
Issue #10771: Clarify that descriptors get used in an *owner* class or one of its parents.
2 parents 27f8709 + 3b654be commit 2052978

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
@@ -1352,10 +1352,11 @@ Implementing Descriptors
13521352
^^^^^^^^^^^^^^^^^^^^^^^^
13531353

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

13601361

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

0 commit comments

Comments
 (0)