Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PEP 573 to the stable ABI #86337

Closed
encukou opened this issue Oct 27, 2020 · 5 comments
Closed

Add PEP 573 to the stable ABI #86337

encukou opened this issue Oct 27, 2020 · 5 comments
Labels
3.10 only security fixes topic-C-API

Comments

@encukou
Copy link
Member

encukou commented Oct 27, 2020

BPO 42171
Nosy @ncoghlan, @scoder, @vstinner, @encukou, @corona10, @miss-islington, @shihai1991
PRs
  • bpo-42171: Add PEP573-related items to the limited API #23009
  • 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:

    assignee = None
    closed_at = <Date 2020-11-10.15:16:08.897>
    created_at = <Date 2020-10-27.14:50:49.749>
    labels = ['expert-C-API', '3.10']
    title = 'Add PEP 573 to the stable ABI'
    updated_at = <Date 2020-11-10.15:16:08.896>
    user = 'https://github.com/encukou'

    bugs.python.org fields:

    activity = <Date 2020-11-10.15:16:08.896>
    actor = 'petr.viktorin'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-11-10.15:16:08.897>
    closer = 'petr.viktorin'
    components = ['C API']
    creation = <Date 2020-10-27.14:50:49.749>
    creator = 'petr.viktorin'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42171
    keywords = ['patch']
    message_count = 5.0
    messages = ['379762', '379765', '379766', '380664', '380675']
    nosy_count = 7.0
    nosy_names = ['ncoghlan', 'scoder', 'vstinner', 'petr.viktorin', 'corona10', 'miss-islington', 'shihai1991']
    pr_nums = ['23009']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42171'
    versions = ['Python 3.10']

    @encukou
    Copy link
    Member Author

    encukou commented Oct 27, 2020

    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 https://github.com/encukou/abi3 (Yes, it has some overlap with Victor's more general notes at https://pythoncapi.readthedocs.io/ )
    But I'd like to get the additions above in to unblock bpo-42111 before I start on improving the stable ABI in general.

    @encukou encukou added 3.10 only security fixes topic-C-API labels Oct 27, 2020
    @encukou
    Copy link
    Member Author

    encukou commented Oct 27, 2020

    Correction: PyModule_AddType is not from PEP-573. I'd like to add it anyway.

    @corona10
    Copy link
    Member

    I'd like to add it anyway.
    Nice ;)

    @miss-islington
    Copy link
    Contributor

    New changeset 0b9c4c6 by Petr Viktorin in branch 'master':
    bpo-42171: Add PEP-573-related items to the limited API (GH-23009)
    0b9c4c6

    @encukou
    Copy link
    Member Author

    encukou commented Nov 10, 2020

    Added.

    @encukou encukou closed this as completed Nov 10, 2020
    @encukou encukou closed this as completed Nov 10, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes topic-C-API
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants