import ast


def builtin_folding(value):
    """ Convert builtin function to ast expression. """
    if value.__name__ in ("bool", "float", "int", "long"):
        name = value.__name__ + "_"
    else:
        name = value.__name__
    return ast.Attribute(ast.Name('__builtin__', ast.Load()),
                         name, ast.Load())