class documentation

class InferenceContext(object): (source)

View In Hierarchy

manages context for analyzing different scope

Method __init__ Undocumented
Method add_call_chain Undocumented
Method get_call_node_chain Undocumented
Method hash_call_context Undocumented
Method map_args_to_func map arbitrary number of args to the target func_node. :param args: positional arguments for mapping to func_node :param func_node: the target function :param offset: offset of args in target_func :param remove_default: flag to determine whether to remove arg in call_context :return: True if type matches, False if otherwise.
Method map_call_node_to_func match the arg from call to args from FunctionDef.
Method push_path to handle the inference path. :return: True if node is already in context path else False :rtype: bool
Method reload_context make sure that the locals in must be the subset of the scope locals. See #mr9ac
Method remove_call_chain Undocumented
Method remove_context Undocumented
Method remove_path Undocumented
Class Variable __slots__ Undocumented
Class Variable id Undocumented
Instance Variable bound_instance Undocumented
Instance Variable call_chain Undocumented
Instance Variable call_context Undocumented
Instance Variable conditions_mode Undocumented
Instance Variable config Undocumented
Instance Variable decorator_ignore Undocumented
Instance Variable globals_context Undocumented
Instance Variable instance_mode Undocumented
Instance Variable inverted_conds Undocumented
Instance Variable is_node_ignore_mode Undocumented
Instance Variable model Undocumented
Instance Variable no_cache Undocumented
Instance Variable path Undocumented
Instance Variable z3_model_used Undocumented
Instance Variable z3_result_hash Undocumented
Instance Variable _id Undocumented
def __init__(self, call_context=None, bound_instance=None, global_context=None, instance_mode=False, config=None, decorator_ignore=None, node_ignore=None, is_node_ignore_mode=False): (source)

Undocumented

def add_call_chain(self, call_node, func_node): (source)

Undocumented

def get_call_node_chain(self, any_node): (source)

Undocumented

def hash_call_context(self): (source)

Undocumented

def map_args_to_func(self, *args, kwargs=None, func_node=None, offset=0, remove_default=True): (source)

map arbitrary number of args to the target func_node. :param args: positional arguments for mapping to func_node :param func_node: the target function :param offset: offset of args in target_func :param remove_default: flag to determine whether to remove arg in call_context :return: True if type matches, False if otherwise.

def map_call_node_to_func(self, call_node, func_node, instance=None, class_instance=None): (source)

match the arg from call to args from FunctionDef.

def push_path(self, node): (source)

to handle the inference path. :return: True if node is already in context path else False :rtype: bool

def reload_context(self, call_stmt, dest_stmt, instance=None, class_instance=None): (source)

make sure that the locals in must be the subset of the scope locals. See #mr9ac

Parameters
call_stmt:nodes.CallUndocumented
dest_stmtUndocumented
instanceUndocumented
class_instanceUndocumented
def remove_call_chain(self, call_node): (source)

Undocumented

def remove_context(self, func_node): (source)

Undocumented

def remove_path(self, node): (source)

Undocumented

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

Undocumented

Undocumented

bound_instance = (source)

Undocumented

call_chain = (source)

Undocumented

call_context = (source)

Undocumented

conditions_mode = (source)

Undocumented

config = (source)

Undocumented

decorator_ignore = (source)

Undocumented

globals_context = (source)

Undocumented

instance_mode = (source)

Undocumented

inverted_conds = (source)

Undocumented

is_node_ignore_mode = (source)

Undocumented

model = (source)

Undocumented

no_cache: bool = (source)

Undocumented

path = (source)

Undocumented

z3_model_used: dict = (source)

Undocumented

z3_result_hash = (source)

Undocumented

Undocumented