class documentation

Represents a function definition. This can be in a #Module for plain functions or in a #Class for methods. The #decorations need to be introspected to understand if the function has a special purpose (e.g. is it a @property, @classmethod or @staticmethod?).

Method __init__ Undocumented
Instance Variable args A list of the function arguments.
Instance Variable decorations A list of decorations used on the function.
Instance Variable modifiers A list of modifiers used in the function definition. For example, the only valid modifier in Python is "async".
Instance Variable return_type The return type of the function as a code string.
Instance Variable semantic_hints A list of hints that describe the object.

Inherited from ApiObject (via Inheritable):

Method sync_hierarchy Synchronize the hierarchy of this API object and all of it's children. This should be called when the #HasMembers.members are updated to ensure that all child objects reference the right #parent. Loaders are expected to return #ApiObject#s in a fully synchronized state such that the user does not have to call this method unless they are doing modifications to the tree.
Instance Variable docstring The documentation string of the API object.
Instance Variable location The location of the API object, i.e. where it is sourced from/defined in the code.
Instance Variable name The name of the entity. This is usually relative to the respective parent of the entity, as opposed to it's fully qualified name/absolute name. However, that is more of a recommendation than rule. For example the #docspec_python loader by default returns #Module objects with their full module name (and does not create a module hierarchy).
Instance Variable parent The parent of the API object.
Property path Returns a list of all of this API object's parents, from top to bottom. The list includes self as the last item.

Inherited from _HasInitAttribsMethod (via Inheritable, ApiObject):

Method _init_attribs A method to define extra attributes that will be set after initialization.
def __init__(self, *_args, modifiers, args, return_type, decorations, semantic_hints=None, **kwargs): (source)

Undocumented

Parameters
*_args:t.AnyUndocumented
modifiers:t.Optional[t.List[str]]Undocumented
args:t.List[Argument]Undocumented
return_type:t.Optional[str]Undocumented
decorations:t.Optional[t.List[Decoration]]Undocumented
semantic_hints:t.Optional[t.List[FunctionSemantic]]Undocumented
**kwargs:t.AnyUndocumented

A list of the function arguments.

A list of decorations used on the function.

A list of modifiers used in the function definition. For example, the only valid modifier in Python is "async".

return_type: t.Optional[str] = (source)

The return type of the function as a code string.

A list of hints that describe the object.