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
{{ message }}
Repository navigation
[C API] Move private PyCode and PyOptimizer API to the internal C API #120642
@iritkatriel@brandtbucher@Fidget-Spinner: Do you know anyone using these unstable functions outside Python itself? They were added to Python 3.13. I propose to move them to <pycore_optimizer.h>. In short, are you ok with #120643 ?
I prefer to move private APIs to the internal C API, and the API is causing C99 compatibility issues in strict mode (pedantic).
From what I am aware of, I don't know anyone using these APIs outside of Python itself. However, they are meant to be used as unstable APIs, so not sure where they are supposed to go normally?
I think it is fine to remove them, as no one is using this API.
If there is interest in the future for plug in optimizers, we would probably want to offer a quite different API that allowed plugins to add additional passes, rather replace the whole of tier 2.
I think it is fine to remove them, as no one is using this API.
Oh ok. I updated my PR to remove the 6 PyUnstable functions from the public C API. Most of them have to be kept for tests, but I renamed them and moved them to the internal C API.
Activity
pythongh-120642: Move private PyCode APIs to the internal C API
ronaldoussoren commentedon Jun 17, 2024
These functions were added in #104584, and may be intended as an API used by other JITs as well (possibly with some changes).
vstinner commentedon Jun 17, 2024
These functions are still exported, but the few other JITs would have to update their code to include
pycore_optimizer.h. Is it ok?ronaldoussoren commentedon Jun 19, 2024
I don't know. @markshannon added these function and may have an opinion on this.
vstinner commentedon Jun 20, 2024
@iritkatriel @brandtbucher @Fidget-Spinner: Do you know anyone using these unstable functions outside Python itself? They were added to Python 3.13. I propose to move them to <pycore_optimizer.h>. In short, are you ok with #120643 ?
I prefer to move private APIs to the internal C API, and the API is causing C99 compatibility issues in strict mode (pedantic).
Fidget-Spinner commentedon Jun 20, 2024
From what I am aware of, I don't know anyone using these APIs outside of Python itself. However, they are meant to be used as unstable APIs, so not sure where they are supposed to go normally?
markshannon commentedon Jun 20, 2024
I think it is fine to remove them, as no one is using this API.
If there is interest in the future for plug in optimizers, we would probably want to offer a quite different API that allowed plugins to add additional passes, rather replace the whole of tier 2.
vstinner commentedon Jun 20, 2024
Oh ok. I updated my PR to remove the 6 PyUnstable functions from the public C API. Most of them have to be kept for tests, but I renamed them and moved them to the internal C API.
gh-120642: Move private PyCode APIs to the internal C API (#120643)
pythongh-120642: Move private PyCode APIs to the internal C API (pyth…
pythongh-120642: Move private PyCode APIs to the internal C API (pyth…
[3.13] gh-120642: Move private PyCode APIs to the internal C API (#12…
pythongh-120642: Move private PyCode APIs to the internal C API (pyth…
pythongh-120642: Move private PyCode APIs to the internal C API (pyth…
pythongh-120642: Move _PyCode_CODE() to the internal C API
gh-120642: Move _PyCode_CODE() to the internal C API (#121644)
pythongh-120642: Move _PyCode_CODE() to the internal C API (pythonGH-…
[3.13] gh-120642: Move _PyCode_CODE() to the internal C API (GH-121644)…
pythongh-120642: Move private PyCode APIs to the internal C API (pyth…
pythongh-120642: Move _PyCode_CODE() to the internal C API (python#12…