You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no usage of _PySys_GetObjectId / _PySys_GetObjectId private APIs in CPython project.
Since these APIs use _Py_Identifier as the parameter, it looks good to be removed this time when there is no usage at all.
But before removing these APIs, I will investigate the current usage of external projects even if they are not intended to be used from outside.
Activity
corona10 commentedon Mar 11, 2022
There is no usage of _PySys_GetObjectId / _PySys_GetObjectId private APIs in CPython project.
Since these APIs use _Py_Identifier as the parameter, it looks good to be removed this time when there is no usage at all.
But before removing these APIs, I will investigate the current usage of external projects even if they are not intended to be used from outside.
corona10 commentedon Mar 11, 2022
./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stdin) // borrowed ref
./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stdout) // borrowed ref
./top_5000/datatable-1.0.0.tar.gz: datatable-1.0.0/src/core/python/obj.cc: _PySys_GetObjectId(&PyId_stderr) // borrowed ref
./top_5000/pickle5-0.0.12.tar.gz: pickle5-0.0.12/pickle5/_pickle.c: modules = _PySys_GetObjectId(&PyId_modules);
corona10 commentedon Mar 11, 2022
@pitrou
https://github.com/pitrou/pickle5-backport/blob/e6117502435aba2901585cc6c692fb9582545f08/pickle5/_pickle.c#L1937
Do you have a plan to use PySys_GetObject("modules") instead of _PySys_GetObjectId(&PyId_modules)?
corona10 commentedon Mar 11, 2022
@vstinner
From my view, PySys_GetObject is available since Python3.2 both APIs look safe to remove.
vstinner commentedon Mar 11, 2022
https://pypi.org/project/pickle5/ should not be used on Python 3.8 and newer: it's a backport for Python 3.7 and older.
vstinner commentedon Mar 11, 2022
_PySys_GetObjectId() and _PySys_GetObjectId() are private API and can be removed anytime. We don't provide any backward compatibility warranty on the private API:
https://docs.python.org/dev/c-api/stable.html#c-api-stability
"Names prefixed by an underscore, such as _Py_InternalState, are private API that can change without notice even in patch releases."
vstinner commentedon Mar 11, 2022
It would be nice to notify datatable, or even propose a PR, if the _PySys_GetObjectId() is removed in Python 3.11.
arhadthedev commentedon Mar 12, 2022
All three occurences look like this 1 for two years (see git blame):
So everything is fixed already.
corona10 commentedon Mar 14, 2022
New changeset bb1c543 by Dong-hee Na in branch 'main':
bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835)
bb1c543