bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI #26241
Conversation
See also the discussion at capi-sig: https://mail.python.org/archives/list/capi-sig@python.org/thread/5QLI3NUP3OSGLCCIBAQOTX4GEJQBWJ6F/ |
|
||
/* Py_FrozenMain is kept out of the Limited API until documented and present | ||
in all builds of Python */ | ||
#ifndef Py_LIMITED_API | ||
PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv); |
@@ -0,0 +1,2 @@ | |||
:c:func:`Py_FrozenMain`, is no longer considered part of the Limited API and Stable ABI, | |||
to which it was added in 3.10.0a4 (bpo-23730). |
vstinner
May 20, 2021
Member
Py_FrozenMain was part of the limited C API in Python 3.9 and before, I don't get "to which it was added in 3.10.0a4", I understand that you're talking about the stable ABI. Since Python 3.10 is not released yet, maybe remove the Stable ABI part and only mention that you remove Py_FrozenMain from the limited C API? Or just write two sentences to clarify the change ;-)
Also, bpo-23730 is unrelated to Py_FrozenMain.
I like to document changes in the limited C API in https://docs.python.org/dev/whatsnew/3.10.html#c-api-changes (in the Removed section).
shihai1991
May 20, 2021
Member
Hm, I find this sentence from PEP-0384: This PEP proposes to define a stable set of API functions which are guaranteed to be available for the lifetime of Python 3. Do we effect any user when the 3.10 version isn't released?
encukou
May 21, 2021
Author
Member
@vstinner, I updated to just a single sentence.
I see "Limited API" as not well defined before 3.10, unlike the Windows stable ABI list. But just noting that it's removed works.
@shihai1991 The trouble is that the set of APIs introduced in PEP 384 wasn't maintained the way the PEP intended.
LGTM, thanks for documenting the removal. I just have a comment about the What's New entry. Feel free to change it or not. |
@@ -1919,6 +1919,11 @@ Porting to Python 3.10 | |||
instead. | |||
(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.) | |||
* The undocumented function ``Py_FrozenMain`` has been removed from the | |||
limited API. The function is mainly useful for custom builds of Python, | |||
and it is not always present when Python is built as a shared library. |
vstinner
May 25, 2021
Member
"when Python is built as a shared library" the symbol is exported, do you mean the opposite? Maybe omit this sentence since I would like this issue to be fixed :-D
d168569
into
python:main
Thanks @encukou for the PR |
…thonGH-26241) Py_FrozenMain was added to the Limited C API in [bpo-42591]() (3.10.0a4); but to fix that issue it would be enough to add it to the regular C API. The function is undocumented, tests were added very recently ([bpo-44131]()), and most importantly, it is not present in all builds of Python, as the linker sometimes omits it as unused. It should be added back when these issues are fixed. Note that this does not affect Python's regular C API. (cherry picked from commit d168569) Co-authored-by: Petr Viktorin <encukou@gmail.com>
Thanks for the review! |
GH-26353 is a backport of this pull request to the 3.10 branch. |
…-26241) (GH-26353) Py_FrozenMain was added to the Limited C API in [bpo-42591]() (3.10.0a4); but to fix that issue it would be enough to add it to the regular C API. The function is undocumented, tests were added very recently ([bpo-44131]()), and most importantly, it is not present in all builds of Python, as the linker sometimes omits it as unused. It should be added back when these issues are fixed. Note that this does not affect Python's regular C API. (cherry picked from commit d168569) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
Py_FrozenMain was added to the Limited C API in bpo-42591 (3.10.0a4);
but to fix that issue it would be enough to add it to the regular C API.
The function is undocumented, tests were added very recently (bpo-44131),
and most importantly, it is not present in all builds of Python, as
the linker sometimes omits it as unused.
It should be added back when these issues are fixed.
Note that this does not affect Python's regular C API.
https://bugs.python.org/issue43795
Automerge-Triggered-By: GH:encukou