[issue36347] Add the constant READWRITE for PyMemberDef

Josh Rosenberg report at bugs.python.org
Mon Mar 18 15:06:08 EDT 2019


Josh Rosenberg <shadowranger+python at gmail.com> added the comment:

Serhiy: Problem is that READONLY already exists, so PY_READWRITE would be inconsistent.

Given currently READONLY is just defined as:

#define READONLY 1

I suppose a solution to maintain consistency (of a sort) would be to add the definitions:

#define PY_READWRITE 0
#define PY_READONLY 1

leaving READONLY defined as well for backwards compatibility.

Names chosen are public names, since I'm pretty sure READONLY is considered part of the public API, given that PyMemberDef and its fields definitely are, and it would be impossible to use the flags field correctly if READONLY wasn't part of the public API.

----------
nosy: +josh.r

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36347>
_______________________________________


More information about the Python-bugs-list mailing list