(attr, var, block, func_ir, loc=unknown_loc, prefix=None, name=None)
return stmt_
Creates variable and assign to it provided attribute.
Creates variable and assign to it provided attribute.
Creates variable and assign to it provided attribute .
def make_getattr(attr, var, block, func_ir, loc=unknown_loc, prefix=None, name=None):
    """
    Creates variable and assign to it provided attribute.
    """

    if prefix is None and name is None:
        prefix = '$_attr_' + attr
    stmt_ = make_assign(Expr.getattr(var, attr, loc), block.scope, func_ir, loc, prefix=prefix, name=name)

    assign = block.find_variable_assignment(var.name)
    if assign is not None:
        block.insert_after(stmt_, assign)
    else:
        block.prepend(assign)

    return stmt_
def make_getattr ( attr , var , block , func_ir , loc = unknown_loc , prefix = None , name = None ) : if prefix is None and name is None : prefix = '$_attr_' + attr stmt_ = make_assign ( Expr . getattr ( var , attr , loc ) , block . scope , func_ir , loc , prefix = prefix , name = name ) assign = block . find_variable_assignment ( var . name ) if assign is not None : block . insert_after ( stmt_ , assign ) else : block . prepend ( assign ) return stmt_