Title: Fix data descriptor detection in inspect.getattr_static
Type: Stage:
Components: Versions: Python 3.7, Python 3.6, Python 3.5, Python 3.3, Python 3.4
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: davidhalter, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-08-11 16:22 by davidhalter, last changed 2017-08-11 16:36 by serhiy.storchaka.

File name Uploaded Description Edit
0001-Fix-data-descriptor-detection-in-inspect.getattr_sta.patch davidhalter, 2017-08-11 16:22 Potential patch that fixes the issue
Messages (2)
msg300170 - (view) Author: David Halter (davidhalter) Date: 2017-08-11 16:22
inspect.getattr_static is currently not identifying data descriptors the right way.

Data descriptors are defined by having a __get__ attribute and at least one of the __set__ and __delete__ attributes.

Implementation detail: Both __delete__ and __get__ set the same slot called tp_descr_set in CPython.

I have attached a patch that fixes the issue IMO.
msg300173 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-08-11 16:36
See also issue26103.
Date User Action Args
2017-08-11 16:36:24serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg300173
2017-08-11 16:22:11davidhaltercreate