Repository navigation
[C API] Move private PyCode and PyOptimizer API to the internal C API #120642
Description
Activity
- added a commit that references this issue
on 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).
These functions were added in #104584, and may be intended as an API used by other JITs as well (possibly with some changes).
These functions are still exported, but the few other JITs would have to update their code to include
pycore_optimizer.h. Is it ok?These functions were added in #104584, and may be intended as an API used by other JITs as well (possibly with some changes).
These functions are still exported, but the few other JITs would have to update their code to include
pycore_optimizer.h. Is it ok?I don't know. @markshannon added these function and may have an opinion on this.
@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.
- added 4 commits that reference this issue
on Jun 26, 2024
The private PyCode and PyOptimizer APIs use "unnamed structs/unions" which are not allowed in ISO C99: see #120293.
I propose to move private PyCode and PyOptimizer APIs to the internal C API.
6 PyUnstable optimizer functions are moved to the internal C API:
Linked PRs