Skip to main content

DocClass

ClassDataClassSource

DocClass(
name: str,
descr: str,
init_func: DocFunction = _default_init(),
init_func_specified: bool = True,
methods: list[DocFunction] = [],
properties: list[DocProp] = [],
operators: list[DocOpTemplate] = [],
abstract_attrs: DocClassAbstractAttrs | None = None,
slang: str = "",
lineno: int = 0,
type: Literal["class"] = "class"
)

The docstring and basic information of a class.

This serializable data type contains the parsed docstrings of the class body, the initialization function, the properties, the methods, and the overloaded operators.

Fields

NameTypeRequired
Description
namestrThe name of the class.
descrstrThe description body of the class.
init_funcDocFunctionThe initialization function of the class.
init_func_specifiedboolA flag. When it is on, it means that the initialization function has been defined by user.
methodslist[DocFunction]The list of methods of this class.
propertieslist[DocProp]The list of properties of this class.
operatorslist[DocOpTemplate]The list of operators of this class.
abstract_attrsDocClassAbstractAttrs | NoneAdditional abstract attributes. Will present only when the class is abstract. For the protocols, this value will be always None.
slangstrThe internal code identifying this class.
linenointThe line number where the class is defined. If the number is unknown, this value will be 0.
typeLiteral["class"]The identifier of this documentation item.