Issue 32400: inspect.isdatadescriptor false negative (original) (raw)

Issue32400

Created on 2017-12-21 18:57 by chnlior, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg308895 - (view) Author: Lior Cohen (chnlior) Date: 2017-12-21 18:57
According to the c code in Include/descrobject.h #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL) and according to the "data model" chapter, a data descriptor is an object who has __set__ and /or __delete__. the "inspect.isdatadescriptor" checks for existence of __get__ and __set__ which IMHO is wrong. an object with __set__/__delete__ only will return falsely False (should be True). This is related to @Serhiy Storchaka comment in issue 26103 opened by @Aaron Hall.
msg319204 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2018-06-10 08:03
@Serhiy Storchaka This issue can be closed due to PR 1959
History
Date User Action Args
2022-04-11 14:58:55 admin set github: 76581
2018-06-10 11:24:32 berker.peksag set status: open -> closedsuperseder: Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)resolution: duplicatestage: patch review -> resolved
2018-06-10 08:03:55 corona10 set pull_requests: - <pull%5Frequest7206>
2018-06-10 08:03:42 corona10 set nosy: + serhiy.storchaka, corona10messages: + pull_requests: + <pull%5Frequest7206>keywords: + patchstage: patch review
2018-05-22 20:30:13 Aaron Hall set nosy: + Aaron Hall
2017-12-21 18:57:44 chnlior set title: inspect.isdatadescriptor fasle negative -> inspect.isdatadescriptor false negative
2017-12-21 18:57:04 chnlior create