what is :exception in a doc string python code example
Example: what is :exception in a doc string python
def func(arg1, arg2):
"""Summary line.
Extended description of function.
:param int arg1: Description of arg1.
:param str arg2: Description of arg2.
:raise: ValueError if arg1 is equal to arg2
:return: Description of return value
:rtype: bool
:example:
>>> a=1
>>> b=2
>>> func(a,b)
True
"""
if arg1 == arg2:
raise ValueError('arg1 must not be equal to arg2')
return True