This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Autogenerate signature for METH_NOARGS and perhaps METH_O extension functions
Type: Stage:
Components: C API Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Antony.Lee
Priority: normal Keywords:

Created on 2020-05-14 11:46 by Antony.Lee, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg368830 - (view) Author: Antony Lee (Antony.Lee) * Date: 2020-05-14 11:46
It would be nice if METH_NOARGS extension methods had an autogenerated signature (or rather, autogenerated __text_signature__ that gets picked up by inspect.signature).  After all, the signature is trivially known at compile time.

The same *could* possibly be done for METH_O methods, for which the effective signature is known too.  The *name* of the sole parameter is not known, but given that the parameter is (I believe?) positional only, that name "shouldn't" really matter (in the sense, e.g., that whether `signature.bind()` succeeds or not doesn't depend on the parameter name).
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84805
2020-05-14 11:46:04Antony.Leecreate