◐ Shell
clean mode source ↗

gh-106320: Remove private _Py_Identifier API by vstinner · Pull Request #108593 · python/cpython

Conversation

@vstinner

Remove the private _Py_Identifier type and related private functions from the public C API:

  • _PyObject_GetAttrId()
  • _PyObject_LookupSpecialId()
  • _PyObject_SetAttrId()
  • _PyType_LookupId()
  • _Py_IDENTIFIER()
  • _Py_static_string()
  • _Py_static_string_init()

Move them to the internal C API: add a new pycore_identifier.h header file. No longer export these functions.

@vstinner

Remove the private _Py_Identifier type and related private functions
from the public C API:

* _PyObject_GetAttrId()
* _PyObject_LookupSpecialId()
* _PyObject_SetAttrId()
* _PyType_LookupId()
* _Py_IDENTIFIER()
* _Py_static_string()
* _Py_static_string_init()

Move them to the internal C API: add a new pycore_identifier.h header
file. No longer export these functions.

@osandov

Is there a recommendation for what to use instead? I read the discussion linked, but it didn't seem like there was a conclusion on the replacement.

@vstinner

Is there a recommendation for what to use instead? I read the discussion linked, but it didn't seem like there was a conclusion on the replacement.

I'm worried about these APIs :-( No consensus was found on a migration plan to move away from this private API. Maybe we should consider adding back the private API for now until a clear consensus is found.

This was referenced

Oct 30, 2023

@vstinner

@osandov:

Is there a recommendation for what to use instead? I read the discussion linked, but it didn't seem like there was a conclusion on the replacement.

I created #111484

Labels