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 — PyModule_FromSlotsAndSpec and PyModule_GetToken exposed without named parameters · Issue #143883 · python/cpython

PyModule_FromSlotsAndSpec and PyModule_GetToken exposed without named parameters #143883

New issue
Copy link
New issue
Copy link
Closed
Closed
PyModule_FromSlotsAndSpec and PyModule_GetToken exposed without named parameters#143883
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

@ngoldbaum
ngoldbaum
opened on Jan 15, 2026
Issue body actions

Most of the public functions in the C API have named parameters and both of these functions are documented with named parameters:

https://docs.python.org/3.15/c-api/module.html#c.PyModule_FromSlotsAndSpec
https://docs.python.org/3.15/c-api/module.html#c.PyModule_GetToken

While wrapping these APIs for PyO3, I noticed that the public definitions just have types for the first parameter without an explicit name:

cpython/Include/moduleobject.h

Lines 120 to 126 in c461aa9

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 15)
PyAPI_FUNC(PyObject *) PyModule_FromSlotsAndSpec(const PyModuleDef_Slot *,
PyObject *spec);
PyAPI_FUNC(int) PyModule_Exec(PyObject *mod);
PyAPI_FUNC(int) PyModule_GetStateSize(PyObject *mod, Py_ssize_t *result);
PyAPI_FUNC(int) PyModule_GetToken(PyObject *, void **result);
#endif

It'd be nice for those interfaces to match the names in the docs.

This code was added in #140556. I don't see any discussion about this, I think it was just missed.

Linked PRs

  • gh-143883: Add missing named parameters in public PyModExport C bindings #143884

Activity

  1. ngoldbaum
    added a commit that references this issue on Jan 15, 2026

    Add missing named parameters in public PyModExport C bindings (python…

    f16b52c
  2. StanFromIreland
    added
    type-featureA feature request or enhancementA feature request or enhancement
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    topic-C-API
    on Jan 15, 2026
  3. ngoldbaum
    added 2 commits that reference this issue on Jan 21, 2026

    Add missing named parameters in public PyModExport C bindings (python…

    a3ab5b8

    Add missing named parameters in public PyModExport C bindings (python…

    50108c5
  4. encukou
    added a commit that references this issue on Jan 27, 2026

    gh-143883: Use named parameters in PyModExport-related declarations &…

    f2b5c20
  5. vstinner
    closed this as completedon Jan 27, 2026
  6. thunder-coding
    added a commit that references this issue on Feb 15, 2026

    pythongh-143883: Use named parameters in PyModExport-related declarat…

    c86394b
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.