irlc.ex01.sphinx.MainClass1.function1

MainClass1.function1(arg1, arg2, arg3)[source]

returns (arg1 / arg2) + arg3

This is a longer explanation, which may include math with latex syntax \(\alpha\). Then, you need to provide optional subsection in this order (just to be consistent and have a uniform documentation. Nothing prevent you to switch the order):

  • parameters using :param <name>: <description>

  • type of the parameters :type <name>: <description>

  • returns using :returns: <description>

  • examples (doctest)

  • seealso using .. seealso:: text

  • notes using .. note:: text

  • warning using .. warning:: text

  • todo .. todo:: text

Advantages:
  • Uses sphinx markups, which will certainly be improved in future version

  • Nice HTML output with the See Also, Note, Warnings directives

Drawbacks:
  • Just looking at the docstring, the parameter, type and return sections do not appear nicely

Parameters
  • arg1 (int, float,...) – the first value

  • arg2 (int, float,...) – the first value

  • arg3 (int, float,...) – the first value

Returns

arg1/arg2 +arg3

Return type

int, float

Example

>>> import template
>>> a = template.MainClass1()
>>> a.function1(1,1,1)
2

Note

can be useful to emphasize important feature

See also

MainClass2

Warning

arg2 must be non-zero.