The information extracted for a function in the documented class.
Public members are:
- name (str): required, the name of the function
- args (list of str): optional, the arguments of the function
- source (str): optional, the source code of the function, including its definition
- docstring (str or None): optional, the docstring of the function
Example
>>> clam_info = ClamInfo("add", args=tuple("a", "b"), source="def add(a, b): return a+b", docstring="Add two args.")
>>> clam_info.name
> add
>>> clam_info.args
> ["a", "b"]
>>> clam_info.source
> "def add(a, b): return a+b"
>>> clam_info.docstring
> "Add two args."
>>> clam_info = ClamInfo("add", args=tuple("a", "b"), source="def add(a, b): return a+b")
>>> clam_info.docstring
> None
Raises
- TypeError: if a given argument is not of the expected type.