[QGIS-Developer] PyQGIS docstrings only show the SIP wrapped function signature, not the actual docstring?

Kevin Stadler e0425926 at student.tuwien.ac.at
Mon Jun 19 14:31:40 PDT 2017


I'm trying to access the docstrings of various QGIS 2.* components
from the IPython console, but instead of the actual documentation I
only seem to get dummy docstrings generated by SIP:

>>> QgsMapLayerRegistry.instance().mapLayers.__doc__
'mapLayers(self) -> object'

>>> QgsMapLayerRegistry.instance().mapLayer.__doc__
'mapLayer(self, QString) -> QgsMapLayer'

>>> QgsVectorLayer.__doc__
'QgsVectorLayer(path: QString = QString.null, baseName: QString =
QString.null, providerLib: QString = QString.null,
loadDefaultStyleFlag: bool = True)'

Using help(...) instead of .__doc__ doesn't look much different. Is
this just something wrong with my build (from the Fedora stable
repository), can somebody reproduce this on a non-Linux build?

I've looked through the mailing list archive but haven't found
anything conclusive. The flag to have SIP generate docstrings
requested here is still enabled:

I'm thinking it might have to do with the new SIP file generation
workflow described here:
although I'm not clear on which branch this actually applies to (and
whether it might be the source or the solution of my problem)?


More information about the QGIS-Developer mailing list