Files
typeshed/stdlib/2/ast.pyi
Guido van Rossum d854d7e2a0 Revert "Fix signature of generic_visit method (#2100)" (#2101)
This reverts commit 39576c5d41.

I merged too soon -- tests are failing.
2018-05-07 11:21:19 -07:00

30 lines
1.0 KiB
Python

# Python 2.7 ast
import typing
from typing import Any, Iterator, Union
from _ast import *
from _ast import AST, Module
__version__ = ... # type: str
PyCF_ONLY_AST = ... # type: int
def parse(source: Union[str, unicode], filename: Union[str, unicode] = ..., mode: Union[str, unicode] = ...) -> Module: ...
def copy_location(new_node: AST, old_node: AST) -> AST: ...
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
def fix_missing_locations(node: AST) -> AST: ...
def get_docstring(node: AST, clean: bool = ...) -> str: ...
def increment_lineno(node: AST, n: int = ...) -> AST: ...
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
def literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ...
def walk(node: AST) -> Iterator[AST]: ...
class NodeVisitor():
def visit(self, node: AST) -> Any: ...
def generic_visit(self, node: AST) -> None: ...
class NodeTransformer(NodeVisitor):
def generic_visit(self, node: AST) -> None: ...