<div dir="ltr">Hi all,<div><br></div><div>I am trying to build QGIS Pypthon API documentation using Sphinx.</div><div>The Python API is built using SIP and I'm wondering which approach I should consider to get full signature (and hopefully from overloaded methods too) in the doc.</div><div>I would like to try avoiding having to write down the signature myself in the docstring, and get a full automatic method (with my overloaded methods :) )</div><div><br></div><div>I have read here that introspection is possible (which apprently wasn't the case before)</div><div><a href="https://stackoverflow.com/a/41245451/1548052">https://stackoverflow.com/a/41245451/1548052</a><br></div><div>It says you can do it automatically (via Argument Clinic [0]) or manually (author's prefered way) via setting PyDoc_STRVAR.</div><div>This sounds a bit obscure to me, I tried to print __text_signature__ on my objects/methods, and always get empty string.</div><div><br></div><div>I read from SIP %Docstring% documentation that as soon as you define a docstrings, it <i>will</i> <i>prevent SIP from generating an automatic docstring that describes the Python signature of a function or method overload</i> [1].</div><div><br></div><div>Now, is there a way of still automatically create the Python signature and prepend it to the custom docstring?</div><div><br></div><div>The only thing I can think of is to build twice, once with and once without argument -o [2] and to get a way to merge them in Sphinx or when creating the rst templates.</div><div><br></div><div>Or is the Argument Clinic the approach?</div><div>Anything else?</div><div><br></div><div><br></div><div>Thanks a lot for any help or participation to the discussion.</div><div>Cheers,</div><div>Denis</div><div><br></div><div>[0] <a href="https://docs.python.org/3/howto/clinic.html">https://docs.python.org/3/howto/clinic.html</a></div><div><div>[1] <a href="http://pyqt.sourceforge.net/Docs/sip4/directives.html#directive-%Docstring">http://pyqt.sourceforge.net/Docs/sip4/directives.html#directive-%Docstring</a></div></div><div>[2] <a href="http://pyqt.sourceforge.net/Docs/sip4/command_line.html#cmdoption-sip-o">http://pyqt.sourceforge.net/Docs/sip4/command_line.html#cmdoption-sip-o</a></div><div><br></div><div><br></div></div>