class documentation

Represents a function definition.

Method __init__ Undocumented
Method signature Get the function's signature.
Class Variable args A list of the function arguments.
Class Variable decorations A list of decorations used on the function.
Class Variable parent The parent of the API object.
Instance Variable is_abstractmethod Whether this Function is a abstract method.
Instance Variable is_async Whether this Function is a coroutine, aka async function.
Instance Variable is_classmethod Whether this Function is a class method.
Instance Variable is_method Whether this Function is a method.
Instance Variable is_property Whether this Function is a property getter.
Instance Variable is_property_deleter Whether this Function is a property deteter.
Instance Variable is_property_setter Whether this Function is a property setter.
Instance Variable is_staticmethod Whether this Function is a static method.
Method _init_attribs A method to define extra attributes that will be set after initialization.

Inherited from Function:

Instance Variable is_type_guarged Undocumented
Instance Variable return_type_ast Undocumented
Class Variable _spec_fields Undocumented

Inherited from Function (via 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 Function, Function, 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).
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 ApiObject (via Function):

Method __repr__ Undocumented
Method __str__ Undocumented
Method add_siblings A new nodes to the tree, siblings to this node.
Method get_member Retrieve a member from the API object. This will always return None for objects that don't support members (eg. Function and Variable).
Method get_members Like get_member but can return several items with the same name.
Method remove Undocumented
Method replace Replace this object by one or more objects.
Method walk Traverse a tree of objects, calling the genericvisitor.Visitor.visit method of visitor when entering each node.
Method walkabout Perform a tree traversal similarly to walk(), except also call the genericvisitor.Visitor.depart method before exiting each node.
Instance Variable root TreeRoot instance holding references to all objects in the tree.
Property dotted_name The fully qualified dotted name of this object, as DottedName instance.
Property full_name The fully qualified dotted name of this object, as string. This value is used as the key in the ApiObject.root.all_objects dictionnary.
Property module Undocumented
Property scope Undocumented
Method _members Undocumented
Method _remove_self Undocumented
Method _repr Undocumented

Inherited from ApiObject (via Function, ApiObject):

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).
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 CanTriggerWarnings (via Function, ApiObject):

Method warn Undocumented

Inherited from GetMembersMixin (via Function, ApiObject):

Method __getitem__ Undocumented

Inherited from ApiObject:

Method expand_name Return a fully qualified name for the possibly-dotted name.
Method resolve_name Return the object named by "name" (using Python's lookup rules) in this context.
Class Variable docstring The documentation string of the API object.
Class Variable location The location of the API object, i.e. where it is sourced from/defined in the code.
Class Variable module Undocumented
Class Variable root TreeRoot instance holding references to all objects in the tree.
Instance Variable aliases Aliases to this object.
Instance Variable doc_sources Objects that can be considered as a source of documentation.
Method _local_to_full_name Undocumented
Method _resolve_indirection Follow an indirection and return the supposed full name of the origin object.

Inherited from ApiObject (via ApiObject):

Method __repr__ Undocumented
Method __str__ Undocumented
Method add_siblings A new nodes to the tree, siblings to this node.
Method get_member Retrieve a member from the API object. This will always return None for objects that don't support members (eg. Function and Variable).
Method get_members Like get_member but can return several items with the same name.
Method remove Undocumented
Method replace Replace this object by one or more objects.
Method walk Traverse a tree of objects, calling the genericvisitor.Visitor.visit method of visitor when entering each node.
Method walkabout Perform a tree traversal similarly to walk(), except also call the genericvisitor.Visitor.depart method before exiting each node.
Property dotted_name The fully qualified dotted name of this object, as DottedName instance.
Property full_name The fully qualified dotted name of this object, as string. This value is used as the key in the ApiObject.root.all_objects dictionnary.
Property scope Undocumented
Method _members Undocumented
Method _remove_self Undocumented
Method _repr Undocumented
Class Variable _spec_fields Undocumented

Inherited from ApiObject (via ApiObject, ApiObject):

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 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).
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 CanTriggerWarnings (via ApiObject, ApiObject):

Method warn Undocumented

Inherited from GetMembersMixin (via ApiObject, ApiObject):

Method __getitem__ Undocumented
def __init__(self, *args, **kwargs): (source)

Undocumented

Parameters
*args:AnyUndocumented
**kwargs:AnyUndocumented
def signature(self, include_types=True, include_defaults=True, include_return_type=True, include_self=True, signature_class=inspect.Signature, value_formatter_class=astroidutils.ValueFormatter): (source)

Get the function's signature.

Parameters
include_types:boolWhether to include the type annotation.
include_defaults:boolWhether to include the default values of parameters.
include_return_type:boolWhether to include the return type annotation.
include_self:boolWhether to include self as the first argument if it exist.
signature_class:Type[inspect.Signature]A custom inspect.Signature subclass to build the signature with.
value_formatter_class:Type[astroidutils.ValueFormatter]A custom astroidutils.ValueFormatter class to present the annotations and parameters default values when calling str() on the signature object.
Returns
inspect.SignatureA signature built with the specified options.

A list of the function arguments.

A list of decorations used on the function.

The parent of the API object.

is_abstractmethod: bool = (source)

Whether this Function is a abstract method.

is_async: bool = (source)

Whether this Function is a coroutine, aka async function.

is_classmethod: bool = (source)

Whether this Function is a class method.

is_method: bool = (source)

Whether this Function is a method.

is_property: bool = (source)

Whether this Function is a property getter.

is_property_deleter: bool = (source)

Whether this Function is a property deteter.

is_property_setter: bool = (source)

Whether this Function is a property setter.

is_staticmethod: bool = (source)

Whether this Function is a static method.

def _init_attribs(self): (source)

A method to define extra attributes that will be set after initialization.

Note
Most attributes don't need a special value at initialization (if they use None as default for instance), in those cases, avoid overriding this method by declaring them as class variable. Override this method only if you have to initialize an attribute value to a mutable object.