DocProp
ClassDataClassSource
DocProp(name: str, descr: str, type: str)
The docstring and basic information of a class property.
A class property can be defined by @property or @functools.cached_property.
Fields
| Name | Type | Required | |
|---|---|---|---|
name | str | The name of the property. | |
descr | str | The description body of the property. | |
type | str | The type of the property. It is usually the typehint (annotation). |
Methods
as_md_text
v_1: str = self.as_md_text(renderer: ProtocolComponent)
Render as Markdown text.
Requires
| Name | Type | Required | |
|---|---|---|---|
renderer | ProtocolComponent | The renderer providing component rendering. |
Returns
| Name | Type | |
|---|---|---|
v_1 | str | The Markdown text rendered from the class property. |
Properties
str_v2
str_v2: str = self.str_v2
Render as V2 string.
The v2 string is in the following format:
prop_name: type = self.prop_name
which is more compact than the default string.