Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Closed
Description
Feature or enhancement
Proposal:
This is partially done, but some functions/methods aren't converted. Perhaps, due to missing support forstarargs / 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