mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-26103: Fix inspect.isdatadescriptor() and a data descriptor definition. (GH-1959)
Look for '__set__' or '__delete__'.
This commit is contained in:
parent
aef639f626
commit
4054b172ab
5 changed files with 62 additions and 4 deletions
|
@ -58,7 +58,7 @@ That is all there is to it. Define any of these methods and an object is
|
|||
considered a descriptor and can override default behavior upon being looked up
|
||||
as an attribute.
|
||||
|
||||
If an object defines both :meth:`__get__` and :meth:`__set__`, it is considered
|
||||
If an object defines :meth:`__set__` or :meth:`__delete__`, it is considered
|
||||
a data descriptor. Descriptors that only define :meth:`__get__` are called
|
||||
non-data descriptors (they are typically used for methods but other uses are
|
||||
possible).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue