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 — Use Argument Clinic for more functions and methods · Issue #155496 · python/cpython

Use Argument Clinic for more functions and methods #155496

New issue
Copy link
New issue
Copy link
Closed
Closed
Use Argument Clinic for more functions and methods#155496
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-argument-clinictype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

Description

@serhiy-storchaka
serhiy-storchaka
opened on Aug 10, 2026
Issue body actions

Many functions and methods implemented in C still parse their arguments with PyArg_ParseTuple() or PyArg_UnpackTuple().
They have no signature for introspection and use the slow METH_VARARGS calling convention.

There are 131 such PyMethodDef entries outside the test modules: _curses 25, _ctypes 16, _interpchannels 13 (GH-139141), time 11, _io 9, _tkinter 8, _thread 6, _csv 5, socket 3, sys 3, and 32 more in 27 files.

A few of them cannot be converted: the behaviour of socket.sendto(), socket.setsockopt() and socket.ioctl() depends on the number or the value of the arguments, and Argument Clinic rejects module-level __getattr__() as a special method.

I am going to submit a separate PR per module.

Linked PRs

  • gh-155496: Use Argument Clinic for more functions of the _io module #155511
  • gh-155496: Use Argument Clinic for more functions of the _ctypes module #155512
  • gh-155496: Use Argument Clinic for more functions in the time module #155513
  • gh-155496: Use Argument Clinic for more functions of the _thread module #155514
  • gh-155496: Use Argument Clinic for the getpath module #158132
  • gh-155496: Use Argument Clinic for more functions of the _csv module #158133
  • gh-155496: Use Argument Clinic for more functions and methods #158134
Reacted by Terry Jan Reedy and An Long

Activity

  1. StanFromIreland
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    topic-argument-clinic
    type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
    on Aug 10, 2026
  2. serhiy-storchaka
    added 9 commits that reference this issue on Sep 21, 2026

    gh-155496: Use Argument Clinic for more functions in the time module (G…

    1596e58

    gh-155496: Use Argument Clinic for more functions of the _io module (G…

    16292fc

    gh-155496: Use Argument Clinic for more functions of the _ctypes modu…

    69f98a5

    gh-155496: Use Argument Clinic for more functions of the _thread modu…

    a5b03fa

    pythongh-155496: Use the Py_UNICODE converter in the getpath module

    c7a7b19

    pythongh-155496: Use the bool return converter in the getpath module

    eb6990c

    gh-155496: Use Argument Clinic for the getpath module (GH-158132)

    964535a

    gh-155496: Use Argument Clinic for more functions of the _csv module (G…

    93142c9

    gh-155496: Use Argument Clinic for more functions and methods (GH-158134

    dc59006
  3. serhiy-storchaka
    closed this as completedon Sep 27, 2026
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

    extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-argument-clinictype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — 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.