[issue45476] [C API] PEP 674: Disallow using macros as l-value

STINNER Victor report at bugs.python.org
Wed Jan 26 11:37:19 EST 2022


STINNER Victor <vstinner at python.org> added the comment:

> In the PyPI top 5000, I found two projects using PyDescr_TYPE() and PyDescr_NAME() as l-value: M2Crypto and mecab-python3. In both cases, it was code generated by SWIG

I created bpo-46538 "[C API] Make the PyDescrObject structure opaque" to handle PyDescr_NAME() and PyDescr_TYPE() macros. But IMO it's not really worth it to make the PyDescrObject structure opaque. It's just too much work, whereas PyDescrObject is not performance sensitive. It's ok to continue exposing this structure in public for now.

I will exclude PyDescr_NAME() and PyDescr_TYPE() from the PEP 674.

----------

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


More information about the Python-bugs-list mailing list