On 2018-09-11 14:20, Steven D'Aprano wrote:
On Tue, Sep 11, 2018 at 08:53:55PM +1000, Steven D'Aprano wrote:
[...]
Or perhaps we could have an officially blessed way to give tools a hint
as to what the real signature is.
class Child(Parent):
@signature_hint(Parent.method)
def method(self, **kwargs):
pass
I was planning to submit a PEP to support a __signature__ attribute
(without the _hint) in inspect.signature(), see PEP 576 and PEP 579 for
some context. The reason is very different from what is suggested here:
to allow implementing custom function-like classes that inspect should
treat as functions.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/