bpo-26103: Fix inspect.isdatadescriptor() and a data descriptor definition. (GH-1959)

Look for '__set__' or '__delete__'.
This commit is contained in:
Aaron Hall, MBA 2018-05-20 19:46:42 -04:00 committed by Serhiy Storchaka
parent aef639f626
commit 4054b172ab
5 changed files with 62 additions and 4 deletions

View file

@ -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).