ast.fix_missing_locations()
ast.fix_missing_locations() is a Python function in the AST Module category. Recursively sets line and column numbers on AST nodes that are missing them. The syntax is ast.fix_missing_locations(node). Returns: Fixed AST node. A typical example: node = ast.Add()
ast.fix_missing_locations(node). A close sibling is ast.literal_eval(), which safely evaluates a string containing a Python literal (list, dict, tuple, number, string, bool, None). A close sibling is ast.parse(), which parses Python source code into an AST (Abstract Syntax Tree). A close sibling is ast.dump(), which returns a formatted string representation of an AST node. A close sibling is ast.walk(), which recursively yields all descendant AST nodes (depth-first). More about this category: Abstract Syntax Tree — literal_eval, parse, dump, walk. Related AST Module entries: ast.literal_eval(), ast.parse(), ast.dump(), ast.walk(), ast.get_source_segment(), ast.copy_location(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.