This module defines all the import used in wralea declarations

core.external.add_docstring(obj)[source]ΒΆ

Decorator that replace a function's docstring by another from obj

This function should be used to decorate your wralea functions when docstring is equivalent to an already existing function or class.

Parameters:obj -- a function or class that contains a docstring
Example:
from math import abs

@add_docstring(abs)
def int_abs_function(x):
    if type(x) == int:
        return abs(x)
    else:
        raise TypeError("expect int as parameter")

Previous topic

<no title>

Next topic

<no title>

This Page