DocArgument
类数据类源码
DocArgument(
name: str,
type: str,
p_type: ParameterKind = ParameterKind.POSITIONAL_OR_KEYWORD,
default: str = "",
doc: list[str] = []
)
函数/方法参数的 docstring。
字段
| 字段 | 类型 | 必选 | |
|---|---|---|---|
name | str | 参数名称。 | |
type | str | 参数的类型。该值通常是该参数的类型提示(标注)。 | |
p_type | ParameterKind | 作为函数参数的类型,参见inspect._ParameterKind. | |
default | str | 参数默认值的格式化结果。 | |
doc | list[str] | 参数的 docstring (按行保存)。 |
方法
format_doc
v_1: str = self.format_doc()
格式化 docstring。
输出
| 参数 | 类型 | |
|---|---|---|
v_1 | str | 当前参数的 docstring。 |