[issue28349] Issues with PyMemberDef flags

New submission from Serhiy Storchaka: 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. ---------- assignee: docs@python components: Documentation messages: 277972 nosy: christian.heimes, docs@python, serhiy.storchaka, skip.montanaro priority: normal severity: normal status: open title: Issues with PyMemberDef flags versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28349> _______________________________________

Serhiy Storchaka added the comment: The latter issue is a duplicate of issue2897. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28349> _______________________________________

Changes by Alexander Belopolsky <alexander.belopolsky@gmail.com>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> include structmember.h in Python.h _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28349> _______________________________________

Serhiy Storchaka added the comment: We still should correct the documentation in 2.7 and 3.x. ---------- resolution: duplicate -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28349> _______________________________________

Alexander Belopolsky added the comment: 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. ---------- nosy: +belopolsky _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28349> _______________________________________

Alexander Belopolsky added the comment: There is also #24065 ("Outdated *_RESTRICTED flags in structmember.h") which I think should be folded into #2897. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28349> _______________________________________

Serhiy Storchaka added the comment: Ah this is a duplicate of issue24065! ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: include structmember.h in Python.h -> Outdated *_RESTRICTED flags in structmember.h _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue28349> _______________________________________
participants (2)
-
Alexander Belopolsky
-
Serhiy Storchaka