Issue 28349: Issues with PyMemberDef flags (original) (raw)

Created on 2016-10-03 18:07 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg277972 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-10-03 18:07
As documented in Doc/extending/newtypes.rst, the flags field of PyMemberDef must be bitwise-or-ed combination of flag constants READONLY, READ_RESTRICTED, WRITE_RESTRICTED and RESTRICTED. There are problems with this: 1. Actually WRITE_RESTRICTED was renamed to PY_WRITE_RESTRICTED in 2.6 (a8dd8874ff2d). I didn't find mention of this backward incompatible change in Misc/NEWS and whatsnew files. 2. Since the support of restricted mode was removed in 3.x, only READONLY flag has effect. Other flags are still documented and used in CPython sources. I think we should get rid of using these flags and undocument them or document as outdated. 3. As noted by Skip Montanaro on the Python-Dev mailing list, these flags (as well as T_* type tags in Include/structmember.h) should have the PY_ prefix.
msg277974 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-10-03 18:14
The latter issue is a duplicate of .
msg277978 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-10-03 18:22
We still should correct the documentation in 2.7 and 3.x.
msg277980 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-10-03 18:24
Serhiy, while I see that you've raised some additional issues here, let's keep the discussion related to Include/structmember.h in one place. I would not mind adding additional affected versions there.
msg277981 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2016-10-03 18:30
There is also #24065 ("Outdated *_RESTRICTED flags in structmember.h") which I think should be folded into #2897.
msg277983 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-10-03 18:35
Ah this is a duplicate of !
History
Date User Action Args
2022-04-11 14:58:37 admin set github: 72535
2016-10-03 18:43:06 belopolsky link issue2897 dependencies
2016-10-03 18:35:06 serhiy.storchaka set status: open -> closedsuperseder: PyMemberDef missing in limited API / Deprecate structmember.h -> Outdated *_RESTRICTED flags in structmember.hmessages: + resolution: duplicatestage: needs patch -> resolved
2016-10-03 18:30:49 belopolsky set messages: +
2016-10-03 18:24:50 belopolsky set nosy: + belopolskymessages: +
2016-10-03 18:22:39 serhiy.storchaka set status: closed -> openresolution: duplicate -> (no value)messages: + stage: resolved -> needs patch
2016-10-03 18:20:01 belopolsky set status: open -> closedsuperseder: PyMemberDef missing in limited API / Deprecate structmember.hresolution: duplicatestage: resolved
2016-10-03 18:14:17 serhiy.storchaka set messages: +
2016-10-03 18:07:59 serhiy.storchaka create