GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a struct, slot & function for checking an extension's ABI · Issue #137210 · python/cpython

Add a struct, slot & function for checking an extension's ABI #137210

New issue
Copy link
New issue
Copy link
Closed
Closed
Add a struct, slot & function for checking an extension's ABI#137210
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement

Description

@encukou
encukou
opened on Jul 29, 2025
Issue body actions

Feature or enhancement

See discussion: https://discuss.python.org/t/module-slot-for-checking-abi-compatibility/96443/

The checks we can do using C API are limited, but would still be useful, e.g. for the case of mixing up GIL-ful and free-threaded extensions/builds.

I propose adding:

  • PyABIInfo struct with:
    • abiinfo_major_version
    • abiinfo_minor_version
    • flags which can be set to:
      • PyABIInfo_DEFAULT_FLAGS
      • PyABIInfo_STABLE
      • PyABIInfo_INTERNAL
      • PyABIInfo_FREETHREADED
      • PyABIInfo_GIL
    • build_version
    • abi_version
  • int PyABIInfo_Check(PyABIInfo *info, const char *module_name)
  • PyABIInfo_VAR(NAME) macro that defines a suitable PyABIInfo variable
  • Py_mod_abi, a module slot that causes a PyABIInfo_Check call

C API WG vote pending: capi-workgroup/decisions#72

Linked PRs

  • gh-137210: Add a struct, slot & function for checking an extension's ABI #137212
  • gh-137210: Move PYTHON_API_VERSION & PYTHON_ABI_VERSION to patchlevel.h #138545

Activity

  1. encukou
    added
    type-featureA feature request or enhancementA feature request or enhancement
    topic-C-API
    on Jul 29, 2025
  2. StanFromIreland
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Jul 29, 2025
  3. encukou
    removed
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Jul 30, 2025
  4. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Aug 1, 2025
  5. encukou
    added a commit that references this issue on Sep 5, 2025

    gh-137210: Add a struct, slot & function for checking an extension's …

    0c74fc8
  6. encukou commented on Sep 5, 2025

    @encukou
    encukou
    on Sep 5, 2025
    MemberAuthor
    More actions

    Keeping open for a touch-up; see #137212 (comment)

  7. encukou
    added a commit that references this issue on Sep 8, 2025

    gh-137210: Move PYTHON_API_VERSION & PYTHON_ABI_VERSION to patchlevel…

    097c563
  8. encukou
    closed this as completedon Sep 8, 2025
  9. lkollar
    added 2 commits that reference this issue on Sep 9, 2025

    pythongh-137210: Add a struct, slot & function for checking an extens…

    8ac4c6e

    pythongh-137210: Move PYTHON_API_VERSION & PYTHON_ABI_VERSION to patc…

    17849df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.