Skip to main content

DocArgument

ClassDataClassSource

DocArgument(
name: str,
type: str,
p_type: ParameterKind = ParameterKind.POSITIONAL_OR_KEYWORD,
default: str = "",
doc: list[str] = []
)

The docstring of a function/method argument.

Fields

NameTypeRequired
Description
namestrThe name of the argument.
typestrThe type of the argument. It is usually the typehint (annotation).
p_typeParameterKindThe argument/parameter type, see inspect._ParameterKind.
defaultstrThe formatted default value of the argument.
doclist[str]The docstring (line-by-line) of the argument.

Methods

format_doc

v_1: str = self.format_doc()

Format the docstring.

Returns

NameType
Description
v_1strThe docstring of the current argument.