[New-bugs-announce] [issue40625] Autogenerate signature for METH_NOARGS and perhaps METH_O extension functions

Antony Lee report at bugs.python.org
Thu May 14 07:46:04 EDT 2020


New submission from Antony Lee <anntzer.lee at gmail.com>:

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

----------
components: C API
messages: 368830
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Autogenerate signature for METH_NOARGS and perhaps METH_O extension functions
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40625>
_______________________________________


More information about the New-bugs-announce mailing list