[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

Eric Snow report at bugs.python.org
Fri Feb 11 11:29:50 EST 2022


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

On Fri, Feb 11, 2022 at 1:36 AM Christoph Reiter <report at bugs.python.org> wrote:
> Sorry if off topic, but I noticed that CPython doesn't deprecate macros in code, while with gcc/clang it's possible to show compiler warnings for them using some pragma magic:
> [snip]
> Maybe that makes getting rid of them easier in the long run?

That's a good question.  We do have Py_DEPRECATED() (in
Include/pyport.h), which is used for symbols.  I'm not sure anyone has
given much thought to deprecating macros, but it's probably worth
considering.  I recommend that you post something about this to
python-dev at python.org.

FWIW, here are other explanations of how to deprecate macros:

* https://stackoverflow.com/questions/57478368/what-is-the-best-way-to-mark-macro-as-deprecated/57479189#57479189
* https://stackoverflow.com/questions/2681259/how-to-deprecate-a-c-pre-processor-macro-in-gcc/29297970#29297970

----------

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


More information about the Python-bugs-list mailing list