You can specify parameter types in Python docstrings as follows:
def __init__(self, canvas, segments): """Class constructor. :param canvas: the PDF canvas object :param segment: The layer segments to be drawn. :type canvas: `canvas.Canvas` :type segments: list of str """ ...
Using the autodoc Sphinx function, this gives a list of parameters, and each parameter is correctly labeled with their types.
But how to do this with instance attributes? Something like that
class Path(object): """ :ivar edge_indices: The indices within `textured_points` of the places. :type edge_indices: list of int """
does not work. After :ivar
you can put a single-word type, but here it consists of three words, so this will not work.
source share