class documentation

Undocumented

Class Method quick_build Undocumented
Class Method quick_build_from_counter_part build this class using counterpart (Name -> AssignName)
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method convert_to_ssa fill the version based on instance() convert_to_ssa will create new instance if it's not found. The overall process is as follow: - if it's in locals (e.g. it's arg), create an instance with the arg object as the key in instance_dict...
Method get_base_var get the base variable string without ssa version
Method get_built_in_type get the built in type class e.g. int, str of this variable representing
Method get_value_from_locals Undocumented
Method get_var_repr get the str representation of current node. The difference between this and __repr__ is at nodes.Attribute, this method will return the attr with the version, not the whole str
Method handle_unresolved_attr generate ssa stmt that act as a stub. when the attribute does not exist, a statement will be created to signal during infer stage that this attribute does not exist. Also will add TempObj in the instance_dict since it's a temporary instance create: Assign: self...
Method is_built_in_type check whether the name represents built in type. Return True when self.id / self.attr represents python built-in type. E.g. int, str etc...
Method is_name_constant Undocumented
Method postinit Undocumented
Method separate_members return a tuple that contain name for each attribute. E.g. a.b.c -> ('a', 'b', 'c')
Instance Variable attr Undocumented
Instance Variable ctx Undocumented
Instance Variable links Undocumented
Instance Variable value Undocumented
Instance Variable version Undocumented
Class Variable _fields Undocumented
Class Variable _other_fields Undocumented

Inherited from Variable:

Static Method build_var build Variable class based on the tuple. E.g. vars=(a, b, c) will return Attribute: (a.b.c)
Method is_load_var checking the 'ctx' if it's available

Inherited from BaseNode (via Variable):

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_statements 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
Method scope return the first containing scope
Method statement 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 InvertCondMixin (via Variable, BaseNode):

Method invert_condition Invert the condition of this node. wrap the node in `not()`
Method wrap_bool Undocumented
@classmethod
def quick_build(cls, value, attr, ctx=None, lineno=None, col_offset=None, parent=None, links=None, version=-1): (source)

Undocumented

@classmethod
def quick_build_from_counter_part(cls, var): (source)

build this class using counterpart (Name -> AssignName)

def __init__(self, lineno=None, col_offset=None, parent=None, links=None, version=-1): (source)
def __repr__(self): (source)

Undocumented

def __str__(self): (source)

Undocumented

def convert_to_ssa(self): (source)

fill the version based on instance() convert_to_ssa will create new instance if it's not found. The overall process is as follow: - if it's in locals (e.g. it's arg), create an instance with the arg object as the key in instance_dict. (no modifying of locals is necessary) - if it's not in locals (e.g. for the case of self.a.b), create UselessStub for the purpose of placing it in locals, and the UselessStub obj will use as key to instance_dict that point to also a newly created instance.

def get_base_var(self): (source)

get the base variable string without ssa version

def get_built_in_type(self): (source)

get the built in type class e.g. int, str of this variable representing

def get_value_from_locals(self): (source)

Undocumented

def get_var_repr(self): (source)

get the str representation of current node. The difference between this and __repr__ is at nodes.Attribute, this method will return the attr with the version, not the whole str

def handle_unresolved_attr(self, scope, var): (source)

generate ssa stmt that act as a stub. when the attribute does not exist, a statement will be created to signal during infer stage that this attribute does not exist. Also will add TempObj in the instance_dict since it's a temporary instance create: Assign: self.value = TempObj() :return:

def is_built_in_type(self): (source)

check whether the name represents built in type. Return True when self.id / self.attr represents python built-in type. E.g. int, str etc...

def is_name_constant(self): (source)

Undocumented

def postinit(self, value, attr, ctx): (source)

Undocumented

def separate_members(self): (source)

return a tuple that contain name for each attribute. E.g. a.b.c -> ('a', 'b', 'c')

value = (source)

Undocumented

_other_fields: tuple[str, ...] = (source)

Undocumented