scipy/weave/ast_tools.py
def build_atom(expr_string):
    """ Build an ast for an atom from the given expr string.

        If expr_string is not a string, it is converted to a string
        before parsing to an ast_tuple.
    """
    # the [1][1] indexing below starts atoms at the third level
    # deep in the resulting parse tree.  parser.expr will return
    # a tree rooted with eval_input -> test_list -> test ...
    # I'm considering test to be the root of atom symbols.
    # It might be a better idea to move down a little in the
    # parse tree. Any benefits? Right now, this works fine.
    if isinstance(expr_string, str):
        ast = parser.expr(expr_string).totuple()[1][1]
    else:
        ast = parser.expr(repr(expr_string)).totuple()[1][1]
    return ast
 Build an ast for an atom from the given expr string.

        If expr_string is not a string, it is converted to a string
        before parsing to an ast_tuple.
    
Build an ast for an atom from the given expr string.
If expr_string is not a string, it is converted to a string
before parsing to an ast_tuple.
Build an ast for an atom from the given expr string . If expr_string is not a string it is converted to a string before parsing to an ast_tuple .
def build_atom(expr_string):
    if isinstance(expr_string, str):
        ast = parser.expr(expr_string).totuple()[1][1]
    else:
        ast = parser.expr(repr(expr_string)).totuple()[1][1]
    return ast
def build_atom ( expr_string ) : if isinstance ( expr_string , str ) : ast = parser . expr ( expr_string ) . totuple ( ) [ 1 ] [ 1 ] else : ast = parser . expr ( repr ( expr_string ) ) . totuple ( ) [ 1 ] [ 1 ] return ast
Build an ast for an atom from the given expr string.
Build an ast for an atom from the given expr string .
""" Build an ast for an atom from the given expr string.

        If expr_string is not a string, it is converted to a string
        before parsing to an ast_tuple.
    """ # the [1][1] indexing below starts atoms at the third level # deep in the resulting parse tree.  parser.expr will return # a tree rooted with eval_input -> test_list -> test ... # I'm considering test to be the root of atom symbols. # It might be a better idea to move down a little in the # parse tree. Any benefits? Right now, this works fine.
expr_string