[PyQt] Custom docstrings and complete signature
denis.rouzaud at gmail.com
Sat Dec 2 00:52:32 GMT 2017
I am trying to build QGIS Pypthon API documentation using Sphinx.
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.
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
I have read here that introspection is possible (which apprently wasn't the
It says you can do it automatically (via Argument Clinic ) or manually
(author's prefered way) via setting PyDoc_STRVAR.
This sounds a bit obscure to me, I tried to print __text_signature__ on my
objects/methods, and always get empty string.
I read from SIP %Docstring% documentation that as soon as you define a
docstrings, it *will* *prevent SIP from generating an automatic docstring
that describes the Python signature of a function or method overload* .
Now, is there a way of still automatically create the Python signature and
prepend it to the custom docstring?
The only thing I can think of is to build twice, once with and once without
argument -o  and to get a way to merge them in Sphinx or when creating
the rst templates.
Or is the Argument Clinic the approach?
Thanks a lot for any help or participation to the discussion.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt