Issue description
On recent enough Python versions (I think 3.4+), non-overloaded Python functions created by pybind11 could set the __text_signature__ attribute to a textual representation of the function signature, instead of prepending it to the docstring (see inspect._signature_from_builtin in the stdlib). This attribute is recognized (and parsed) by at least pydoc and inspect.signature (and thus, I guess, Sphinx too, though I am not sure), so it would perform the task of communicating the function signature better than the current method.
(Originally posted on gitter, it was suggested that I put the proposal here.)
Reproducible example code
N/A
Issue description
On recent enough Python versions (I think 3.4+), non-overloaded Python functions created by pybind11 could set the
__text_signature__attribute to a textual representation of the function signature, instead of prepending it to the docstring (seeinspect._signature_from_builtinin the stdlib). This attribute is recognized (and parsed) by at least pydoc and inspect.signature (and thus, I guess, Sphinx too, though I am not sure), so it would perform the task of communicating the function signature better than the current method.(Originally posted on gitter, it was suggested that I put the proposal here.)
Reproducible example code
N/A