Lines Matching defs:ast
9 import ast
3949 Takes an ast.Expr node. Compiles and evaluates it.
3956 if isinstance(node, ast.Expr):
3959 node = ast.Expression(node)
4338 module = ast.parse(ast_input)
4549 module = ast.parse(ast_input)
4557 module = ast.parse(ast_input)
4603 module = ast.parse(ast_input)
4608 # of disallowed ast nodes.
4609 class DetectBadNodes(ast.NodeVisitor):
4650 if isinstance(expr, ast.Name) and expr.id == 'NULL':
4654 elif (isinstance(expr, ast.BinOp) or
4655 (isinstance(expr, ast.UnaryOp) and
4656 not (isinstance(expr.operand, ast.Num) or
4657 (hasattr(ast, 'Constant') and
4658 isinstance(expr.operand, ast.Constant) and
4663 fail("When you specify an expression (" + repr(default) + ") as your default value,\nyou MUST specify a valid c_default." + ast.dump(expr))
4666 elif isinstance(expr, ast.Attribute):
4669 while isinstance(n, ast.Attribute):
4672 if not isinstance(n, ast.Name):
4686 value = ast.literal_eval(expr)
4761 if (hasattr(ast, 'Constant') and
4762 isinstance(annotation, ast.Constant) and
4766 if isinstance(annotation, ast.Str):
4769 if isinstance(annotation, ast.Name):
4772 if not isinstance(annotation, ast.Call):