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 — Convert the struct module to use the Argument Clinic · Issue #143672 · python/cpython

Convert the struct module to use the Argument Clinic #143672

New issue
Copy link
New issue
Copy link
Closed
Closed
Convert the struct module to use the Argument Clinic#143672
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-argument-clinictype-featureA feature request or enhancementA feature request or enhancement

Description

@skirpichev
skirpichev
opened on Jan 11, 2026
Issue body actions

Feature or enhancement

Proposal:

This is partially done, but some functions/methods aren't converted. Perhaps, due to missing support for starargs / var-positional parameters. Now it's possible. This also will fix some signatures.

>>> import inspect, struct
>>> help(struct.pack)
Help on built-in function pack in module _struct:

pack(...)
    pack(format, v1, v2, ...) -> bytes

    Return a bytes object containing the values v1, v2, ... packed according
    to the format string.  See help(struct) for more on format strings.

>>> inspect.signature(struct.pack)
Traceback (most recent call last):
  File "<python-input-6>", line 1, in <module>
    inspect.signature(struct.pack)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/local/lib/python3.15/inspect.py", line 3346, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                   globals=globals, locals=locals, eval_str=eval_str,
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                   annotation_format=annotation_format)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.15/inspect.py", line 3061, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
                                    follow_wrapper_chains=follow_wrapped,
                                    globals=globals, locals=locals, eval_str=eval_str,
                                    annotation_format=annotation_format)
  File "/usr/local/lib/python3.15/inspect.py", line 2542, in _signature_from_callable
    return _signature_from_builtin(sigcls, obj,
                                   skip_bound_arg=skip_bound_arg)
  File "/usr/local/lib/python3.15/inspect.py", line 2326, in _signature_from_builtin
    raise ValueError("no signature found for builtin {!r}".format(func))
ValueError: no signature found for builtin <built-in function pack>

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-143672: convert the struct module to AC #143673
  • gh-143672: Finish conversion of the struct module to Argument Clinic #143857
  • gh-143672: Add more tests for struct.pack_into() #143901
  • [3.14] gh-143672: Add more tests for struct.pack_into() (GH-143901) #143902
  • [3.13] gh-143672: Add more tests for struct.pack_into() (GH-143901) #143903

Activity

  1. skirpichev
    self-assigned this
    on Jan 11, 2026
  2. skirpichev
    added
    type-featureA feature request or enhancementA feature request or enhancement
    topic-argument-clinic
    on Jan 11, 2026
  3. skirpichev
    added a commit that references this issue on Jan 11, 2026

    pythongh-143672: convert the struct module to AC

    877f65d
  4. skirpichev
    removed their assignment
    on Jan 11, 2026
  5. picnixz
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Jan 11, 2026
  6. serhiy-storchaka
    marked Finish conversion of the struct module to Argument Clinic #143856 as a duplicate of this issue on Jan 15, 2026
  7. serhiy-storchaka
    added a commit that references this issue on Jan 16, 2026

    gh-143672: Add more tests for struct.pack_into() (GH-143901)

    66680f1
  8. miss-islington
    added 2 commits that reference this issue on Jan 16, 2026

    pythongh-143672: Add more tests for struct.pack_into() (pythonGH-143901)

    9db4e97

    pythongh-143672: Add more tests for struct.pack_into() (pythonGH-143901)

    e0e1415
  9. serhiy-storchaka
    added a commit that references this issue on Jan 16, 2026

    gh-143672: Finish conversion of the struct module to Argument Clinic (G…

    780e969
  10. serhiy-storchaka
    closed this as completedon Jan 16, 2026
  11. serhiy-storchaka
    added 2 commits that reference this issue on Jan 16, 2026

    [3.13] gh-143672: Add more tests for struct.pack_into() (GH-143901) (G…

    d7f11ea

    [3.14] gh-143672: Add more tests for struct.pack_into() (GH-143901) (G…

    8c250cf
  12. thunder-coding
    added 2 commits that reference this issue on Feb 15, 2026

    pythongh-143672: Add more tests for struct.pack_into() (pythonGH-143901)

    25b3e24

    pythongh-143672: Finish conversion of the struct module to Argument C…

    87d41e1
  13. serhiy-storchaka
    added this to Struct, memoryview and array issues 🏗️on Jul 13, 2026
  14. github-project-automation
    moved this from Todo to Done in Struct, memoryview and array issues 🏗️on Jul 13, 2026
  15. github-project-automation
    moved this to Todo in Struct, memoryview and array issues 🏗️on Jul 13, 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-featureA feature request or enhancementA feature request or enhancement

    Projects

    • Struct, memoryview and array issues 🏗️
      Status
      Done
      Show more project fields

    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.