[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-19 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @Serhiy I have updated my branch with your recommendation. 1. rename READONLY, etc... to PY_READONLY. Why the PY_ prefix, because there was a renaming for WRITE_RESTRICTED to PY_WRITE_RESTRICTED. in that case, I wanted to keep the same change. 2. Updated t

[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Josh Rosenberg
Josh Rosenberg 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_RE

[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It does not follow the convention for names in the C API. All public names should have prefix Py or PY, all private user visible names should have prefix _Py or _PY. Some existing names do not follow that convention, but we should fix this and do not add

[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- keywords: +patch pull_requests: +12364 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue36347] Add the constant READWRITE for PyMemberDef

2019-03-18 Thread Stéphane Wirtel
New submission from Stéphane Wirtel : When we define some members with PyMemberDef, we have to specify the flag for read-write or read-only. static PyMemberDef members[] = { {"name", T_OBJECT, offsetof(MyObject, name), 0, "Name object"}, {NULL} // Sentinel }; For a newcomer, when you