documented

This is my module brief line.

This is a more complete paragraph documenting my module.

  • A list item.
  • Another list item.

This section can use any reST syntax.

Functions

  • a_function(): This is the brief description of my function.
documented.a_function(my_arg, another)

This is the brief description of my function.

This is a more complete example of my function. It can include doctest, code blocks or any other reST structure.

>>> a_function(10, [MyClass('a'), MyClass('b')])
20
Parameters:
  • my_arg (int) – The first argument of the function. Just a number.
  • another (A list of MyClass) – The other argument of the important function.
Returns:

The length of the second argument times the first argument.

Return type:

int

Classes

class documented.MyClass(param1, param2=None)

This is the brief of my main class.

A more general description of what the class does.

Parameters:
  • param1 (int) – The first parameter of my class.
  • param2 (int or float) – The second one.
Variables:

my_attribute – Just an instance attribute.

Raises:

TypeError – if param2 is not None.

Inheritance

Inheritance diagram of MyClass
class_attribute = 625

This is a class attribute.

my_method(param1, param2)

The brief of this method.

This method does many many important things.

Parameters:
  • param1 (int) – A parameter.
  • param2 (list) – Another parameter.
Returns:

A list of the first parameter as long a the length of the second parameter.

Return type:

list of int

class documented.AnotherClass(param1, param2=None)

This another class.

Check the nice inheritance diagram. See MyClass.

Inheritance

Inheritance diagram of AnotherClass

Exceptions

exception documented.MyException

This is my custom exception.

This is a more complete description of what my exception does. Again, you can be as verbose as you want here.

Inheritance

Inheritance diagram of MyException

Variables

documented.A_CONSTANT

This is an important constant.

1000
documented.YET_ANOTHER

Yet another public constant variable

{'jam': 'eggs',
 'this': 'that',
 'yet': {'things': [1, 2, 3, 'a'], 'tuples': (1000, 4)}}