
+1 for overall. On Thu, Feb 3, 2022 at 7:45 AM Eric Snow <ericsnowcurrently@gmail.com> wrote:
I'd also like to actually get rid of _Py_IDENTIFIER(), along with other related API including ~14 (private) C-API functions. Dropping all that helps reduce maintenance costs. However, at least one PyPI project (blender) is using _Py_IDENTIFIER(). So, before we could get rid of it, we'd first have to deal with that project (and any others).
It would be nice to provide something similar to _PY_IDENTIFIER, but designed (and documented) for 3rd party modules like this. ``` typedef struct { Py_IDENTIFIER(foo); ... } Modstate; ... // in some func Modstate *state = (Modstate*)PyModule_GetState(module); PyObject_GetAttr(o, PY_IDENTIFIER_STR(state->foo)); ... // m_free() static void mod_free(PyObject *module) { Modstate *state = (Modstate*)PyModule_GetState(module); Py_IDENTIFIER_CLEAR(state->foo); } ``` -- Inada Naoki <songofacandy@gmail.com>