This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Add PEP 573 to the stable ABI
Type: Stage: resolved
Components: C API Versions: Python 3.10
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: corona10, miss-islington, ncoghlan, petr.viktorin, scoder, shihai1991, vstinner
Priority: normal Keywords: patch

Created on 2020-10-27 14:50 by petr.viktorin, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23009 merged petr.viktorin, 2020-10-27 22:08
Messages (5)
msg379762 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-10-27 14:50
The following PEP 573 were not added to the Windows list of stable ABI symbols (PC/python3dll.c):
- PyModule_AddType
- PyType_FromModuleAndSpec
- PyType_GetModule
- PyType_GetModuleState

I'd like to add them.

Also, the PEP introduces the (METH_FASTCALL | METH_KEYWORDS | METH_METHOD) calling convention, but METH_FASTCALL is not part of the stable ABI (and it other uses are not suitable for stable ABI).
I propose adding a new value, METH_METHOD_ARGS_KWD (name up for bikeshedding), which would be equal to (METH_FASTCALL | METH_KEYWORDS | METH_METHOD) but part of the limited API.

Does that sound like a good idea?

On the sprint, Steve mentioned that it would be possible to backport this to Python 3.9.1, even though it would mean a weird minor-version requirement.
I no longer think that's a good idea: fixing the stable ABI will be a longer-term project, and I don't want to fight issues in a 3.9 backport.

FWIW, for the longer-term project, I started a brainstorming repo at (Yes, it has some overlap with Victor's more general notes at )
But I'd like to get the additions above in to unblock #42111 before I start on improving the stable ABI in general.
msg379765 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-10-27 15:20
Correction: PyModule_AddType is not from PEP 573. I'd like to add it anyway.
msg379766 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-10-27 15:22
> I'd like to add it anyway.
Nice ;)
msg380664 - (view) Author: miss-islington (miss-islington) Date: 2020-11-10 13:47
New changeset 0b9c4c6fcf2b0673fa45ddfa092934a9d5479b8c by Petr Viktorin in branch 'master':
bpo-42171: Add PEP573-related items to the limited API (GH-23009)
msg380675 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-11-10 15:16
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86337
2020-11-10 15:16:08petr.viktorinsetstatus: open -> closed
resolution: fixed
messages: + msg380675

stage: patch review -> resolved
2020-11-10 13:47:40miss-islingtonsetnosy: + miss-islington
messages: + msg380664
2020-10-29 15:33:23shihai1991setnosy: + shihai1991
2020-10-27 22:08:33petr.viktorinsetkeywords: + patch
stage: patch review
pull_requests: + pull_request21925
2020-10-27 15:22:07corona10setnosy: + corona10
messages: + msg379766
2020-10-27 15:20:34petr.viktorinsetmessages: + msg379765
2020-10-27 14:50:49petr.viktorincreate