class documentation

class AsyncFunctionDef(FunctionDef): (source)

View In Hierarchy

Undocumented

Inherited from FunctionDef:

Method __init__ Undocumented
Method __repr__ Undocumented
Method assign_instance point the arg to the class_instance during inference stage. if duplicate_ins is True, the class_instance will be duplicated, this means that any attribute that assigned to the instance will not affect the original class instance...
Method generate_ssa_decorator generate an expression to rename all the decorators create stmt: Expr: decorators :return: Expr
Method generate_ssa_func generate multiple statement to simulate renaming of Scope without body. 1. generate Name object for scope name. 2. collect all Name object to be rename except body. create stmt: Assign: {self.func} = Proxy(self) Expr: {list of collected name} :return: tuple of statement...
Method get_arg_instance get the instance for arg This can be use to check the instance modify in this scope. E.g.: >>> from klara.tools.tree_rewriter import AstBuilder >>> tree = AstBuilder().string_build("def __init__(self): self...
Method get_return_type E.g. def foo(a: int) will return the type int Raise:
Method get_statements Undocumented
Method init_class_methods necessary initialization involving method. This will setup the `self` argument to contain the class available attribute.
Method is_constructor Undocumented
Method is_property Undocumented
Method postinit Undocumented
Instance Variable args Undocumented
Instance Variable body Undocumented
Instance Variable called_by Undocumented
Instance Variable decorator_list Undocumented
Instance Variable name Undocumented
Instance Variable return_nodes Undocumented
Instance Variable returns Undocumented
Property type return the function type for this node Possibles values are method, function, staticmethod and classmethod. Doesn't handle decorator resolving yet. Only statically check the functionDef itself.
Class Variable _fields Undocumented
Class Variable _other_fields Undocumented

Inherited from LocalsDictNode (via FunctionDef):

Class Method from_other_instance Undocumented
Method create_latest_stmt Undocumented
Method get_latest_stmt return the latest statement in locals dict
Method get_latest_stmt_from_stack Get the latest version from stack, and get the corresponding statement
Method get_version get the version number of the var, create the var entry if it's not exists
Method remove_version Undocumented
Method resolve_instance Undocumented
Method scope return the first containing scope
Method update_version increment the version of the var inside the dict and return the version number :param var: :param block_label: :return:
Instance Variable containing_scope Undocumented
Instance Variable global_var Undocumented
Instance Variable instance_dict Undocumented
Instance Variable locals Undocumented
Instance Variable ssa_record Undocumented

Inherited from Statement (via FunctionDef, LocalsDictNode):

Method get_all_replaced_links Get all replaced links' statement, traversing the links
Method get_call_node To be implemented in Assign and Expr
Method get_lhs_value get targets variable that is associated with rhs variable var E.g. a.b = c.d = d calling get_lhs_value(d) will return [a.b, c.d] a.b, e.f, f.g = c.d, d.e, g = d, e, f calling get_lhs_value(f) will return [f...
Method get_rhs_value get variable in rhs that is associate with var in lhs E.g. a, b, c = d ,e, f = g, h, i calling `get_rhs_value(b)` will return h :param var: the variable in the targets :return: Variable in rhs
Method get_targets To be implemented in Assign and AugAssign. Return the targets variable
Method get_values To be implemented in Assign and AugAssign
Method statement Undocumented
Instance Variable is_phi Undocumented
Instance Variable replaced_links Undocumented
Static Method _get_real_slice_from_var construct a real slice() object based on the relationship of var in container :param var: variable refer to construct the slice :param container: the container that contain variable var :return: a slice() object...
Method _get_value_from_opposite_assignment Get the `value` that is stored in `value_container` in the `target_container` also help to unpack the value. It follows the steps below: 1. get the real slice value from the relationship of `value` in `value_container` 2...

Inherited from BaseNode (via FunctionDef, LocalsDictNode, Statement):

Static Method get_inferred Undocumented
Method __contains__ Undocumented
Method accept Undocumented
Method dunder_lookup try to resolve the dunder method
Method generic_visit Undocumented
Method get_bound_conditions Undocumented
Method get_children Undocumented
Method get_from_outer find the definition of `var` from outer scope recursively. Skip param will determine how many parent scope to skip :param var: variable of interest :param skip: how many layer of parent scope to skip :return:...
Method get_parent_of_type Undocumented
Method get_stmt_target Undocumented
Method get_target_instance get the assigning target instance rather than scope(). See #mr68u a.b.c = node calling node.get_target_instance() will return `a.b.c.instance()`
Method is_children check if the given node is part of 'self' or children
Method iter_fields Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` that is present on *node*.
Method prepare_inferred_value Undocumented
Instance Variable col_offset Undocumented
Instance Variable explicit_inference Undocumented
Instance Variable lineno Undocumented
Instance Variable parent Undocumented
Instance Variable refer_to_block Undocumented

Inherited from FunctionMixin (via FunctionDef, LocalsDictNode, Statement, BaseNode, ScopeSsaMixin):

Method mock_args insert a statement with targets=all the argument starting with offset. Mainly for renaming :param offset: The offset of arg to apply :return: None