(var, block, func_ir)
return None
Returns tuple items. If tuple is constant creates and returns constants
Returns tuple items. If tuple is constant creates and returns constants
Returns tuple items . If tuple is constant creates and returns constants
def get_tuple_items(var, block, func_ir):
    """
    Returns tuple items. If tuple is constant creates and returns constants
    """

    def wrap_into_var(value, block, func_ir, loc):
        stmt = declare_constant(value, block, func_ir, loc)

        return stmt.target

    val = guard(find_const, func_ir, var)
    if val is not None:
        if isinstance(val, tuple):
            return [wrap_into_var(v, block, func_ir, var.loc) for v in val]

        return None

    try:
        rhs = func_ir.get_definition(var)
        if isinstance(rhs, Expr):
            if rhs.op == 'build_tuple':
                return list(rhs.items)
    except Exception:
        pass

    return None
def get_tuple_items ( var , block , func_ir ) : def wrap_into_var ( value , block , func_ir , loc ) : stmt = declare_constant ( value , block , func_ir , loc ) return stmt . target val = guard ( find_const , func_ir , var ) if val is not None : if isinstance ( val , tuple ) : return [ wrap_into_var ( v , block , func_ir , var . loc ) for v in val ] return None try : rhs = func_ir . get_definition ( var ) if isinstance ( rhs , Expr ) : if rhs . op == 'build_tuple' : return list ( rhs . items ) except Exception : pass return None