[issue36347] Renaming the constants for the .flags of PyMemberDef

Ronald Oussoren report at bugs.python.org
Mon Mar 25 06:13:46 EDT 2019


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

A discussion on the use of enum and deprecation warnings might be useful, although there is a significant risk on bike shedding.

I agree that formally deprecating READONLY can lead to uglier code in extension that use the value and need to support anything beyond the bleeding edge (although the complication isn't that bad: just add a conditional definition of PY_READONLY).  I'm personally not to worried about this, and generally prefer being more aggressive with adding deprecation warnings.


W.r.t. C++ and enums: that should be ok, especially when using anonymous enums that are basically only used to name constants.  

Bitmask with enums can be more problematic when using named enums that are also used for variable definitions because C++ compilers are allowed to use the minimal variable size that can represent all defined values (that's also a problem for the ABI), but it is also possible to use scoped enums to specify the size of values.

----------

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


More information about the Python-bugs-list mailing list