DocumentedFunction
A `DocumentedItem` subclass for python functions.
- MRO
- ⎿⎽⎽HasRaises
- ⎿⎽⎽⎽HasReturns
- ⎿⎽⎽⎽⎽HasDecorators
- ⎿⎽⎽⎽⎽⎽DocumentedItem
- ⎿⎽⎽⎽⎽⎽⎽DocumentedFunction
Methods
__init__(self, obj : GriffeObjType) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
obj
- Type
- GriffeObjType
- Default
- Description
set_parameter_docs(self, obj : GriffeObjType) -> None
Passes parameter docstrings in from another object, i.e. parameters which are documented as "Args" of a class `C` should be passed to the `C.__init__` function
Parameters
- Name
self
- Type
- Default
- Description
- Name
obj
- Type
- GriffeObjType
- Default
- Description
as_dict(self) -> dict[str, typing.Any]
Response
- Type
- dict[str, typing.Any]
- Description
get_docstring(self, kind : str) -> typing.Optional[str]
Extract a `griffe.DocstringSection` of a given `kind`s parsed value.
Parameters
- Name
self
- Type
- Default
- Description
- Name
kind
- Type
- str
- Default
- Description
The kind of `griffe.DocstringSection` to extract. Valid values are `text`, `parameters`, `returns`, `raises`, and `examples`.
Response
- Type
- typing.Optional[str]
- Description
Attributes
- Name
obj
- Type
- griffe.Function
- Value
= None
- Description
- Name
param_docs
- Type
- Value
= None
- Description
- Name
parameters
- Type
- list[Parameter]
- Value
= None
- Description
- Name
type
- Type
- Value
= type_
- Description
- Name
name
- Type
- Value
= get_name(obj)
- Description
- Name
path
- Type
- Value
= str(obj.relative_package_filepath)
- Description
- Name
parent
- Type
- Value
= obj.parent if obj.parent is None else get_name(obj.parent)
- Description
- Name
description
- Type
- Value
= self.get_docstring('text')
- Description
- Name
lines
- Type
- Value
= () if self.type == 'package' else (obj.lineno, obj.endlineno)
- Description
- Name
decorators
- Type
- list[str]
- Value
= None
- Description
- Name
returns
- Type
- typing.Optional[DescriptionAndAnnotation]
- Value
= None
- Description
- Name
throws
- Type
- list[DescriptionAndAnnotation]
- Value
= None
- Description
- Name
examples
- Type
- list[Example]
- Value
= None
- Description