Files
typeshed/stdlib/2/ast.pyi
Svyatoslav Ilinskiy 3f9fafbbb7 Re-export code from _ast into ast. (#1515)
After mypy [started hiding](https://github.com/python/mypy/pull/3706) imported names in stubs unless `from ... import ...` is used, we found an error with stubs of ast module. 

It looks like ast module should re-export everything in `_ast` and according to PEP 484, it can do that by doing `from _ast import *`, so this is what this PR does.
2017-08-03 15:57:20 -07:00

29 lines
1.0 KiB
Python

# Python 2.7 ast
import typing
from typing import Any, Iterator, Union
from _ast import *
__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: ...