Repository navigation
Implement PEP 652 -- Maintaining the Stable ABI #87961
Description
Activity
New changeset 92eebf6 by Petr Viktorin in branch 'master':
bpo-43795: Sort PC/python3dll.c (GH-25312)
92eebf6Opened as a separate issue: bpo-43868, Remove PyOS_ReadlineFunctionPointer from the stable ABI list
I unsure about the following symbols.
Victor, do you think they should be part of the stable ABI?- PyThreadState_DeleteCurrent
- Py_GetArgcArgv
- PyInterpreterState_GetID
PyThreadState_DeleteCurrent
No.
bpo-37878 explicitly excluded it from the limited C API. IMO it's too close to the CPython implementation and so must not be added to the stable ABI.
Py_GetArgcArgv
No.
Python 3.10 now provides sys.orig_argv which can be read in C.
https://docs.python.org/dev/library/sys.html#sys.orig_argvPy_GetArgcArgv() is part of the "legacy" C API to initialize Python. The "new" PyConfig API provides PyConfig.orig_argv.
FYI in the PyPI top 4000 projects, the function seems to be called by the following projects:
2021-02-18/uWSGI-2.0.19.1.tar.gz
2021-02-18/stem-1.8.0.tar.gz
2021-02-18/sphinx-gallery-0.8.2.tar.gz
2021-02-18/setproctitle-1.2.2.tar.gz
2021-02-18/pyuwsgi-2.0.19.1.post0.tar.gz
2021-02-18/mercurial-5.7.tar.gz
2021-02-18/httpretty-1.0.5.tar.gz
2021-02-18/CherryPy-18.6.0.tar.gz
2021-02-18/aws-encryption-sdk-cli-2.1.0.tar.gzPyInterpreterState_GetID
Yes.
It's part of the limited C API. IMO technically, it's ok to add to the stable ABI. I added it to PC/python3dll.c on purpose. Sadly, it's not available on PyPy, but I don't think that the stable ABI must care about PyPy which is a different use case.
Thanks! I'll send PRs later.
Thanks for linking to the issues/documentation!
I see that Py_GetArgcArgv it was exported in python3.def (i.e. stable ABI) in bpo-40910, which got backported to 3.9.
And the removal of PyThreadState_DeleteCurrent was reverted: bpo-38266
While we would like to deprecate/remove them in the future, they are now part of the stable ABI.
They are now in internal headers, so I will exclude them from the limited API.Should we mention PEP-652 in Include/README.rst, now that the PEP is accepted?
Should we mention PEP-652 in Include/README.rst, now that the PEP is accepted?
No, we should link to the documentation (when it's written). The PEP is a design document; it'll become outdated.
Right now, running "make regen-limited-abi" adds again functions which were removed from Doc/data/stable_abi.dat:
#25687 (comment)diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index cdc7160250..6fe61743d6 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -351,11 +351,17 @@ PyMapping_Length PyMapping_SetItemString PyMapping_Size PyMapping_Values +PyMarshal_ReadObjectFromString +PyMarshal_WriteLongToFile +PyMarshal_WriteObjectToFile +PyMarshal_WriteObjectToString PyMem_Calloc PyMem_Free PyMem_Malloc PyMem_Realloc PyMemberDescr_Type +PyMember_GetOne +PyMember_SetOne PyMemoryView_FromMemory PyMemoryView_FromObject PyMemoryView_GetContiguous
I guess that you should not be added until this issue is solved.
I hope the PR fixes that. I plan to merge tomorrow if there ar no objections to it.
On April 28, 2021 5:15:19 PM GMT+02:00, STINNER Victor <report@bugs.python.org> wrote:
STINNER Victor <vstinner@python.org> added the comment:
Right now, running "make regen-limited-abi" adds again functions which
were removed from Doc/data/stable_abi.dat:
#25687 (comment)diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat
index cdc7160250..6fe61743d6 100644
--- a/Doc/data/stable_abi.dat
+++ b/Doc/data/stable_abi.dat
@@ -351,11 +351,17 @@ PyMapping_Length
PyMapping_SetItemString
PyMapping_Size
PyMapping_Values
+PyMarshal_ReadObjectFromString
+PyMarshal_WriteLongToFile
+PyMarshal_WriteObjectToFile
+PyMarshal_WriteObjectToString
PyMem_Calloc
PyMem_Free
PyMem_Malloc
PyMem_Realloc
PyMemberDescr_Type
+PyMember_GetOne
+PyMember_SetOne
PyMemoryView_FromMemory
PyMemoryView_FromObject
PyMemoryView_GetContiguousI guess that you should not be added until this issue is solved.
----------
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43795\>
7 remaining items
Another docs fixup: #93581
- added a commit that references this issue
on Jun 8, 2022 - added a commit that references this issue
on Jun 26, 2022
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: