Add Python 3 ast module; update Python 2.7 ast module; fixup typed_ast (#170)

This commit is contained in:
David Fisher
2016-05-04 10:40:36 -07:00
committed by Guido van Rossum
parent 8dff6e481e
commit e8f626536e
6 changed files with 838 additions and 629 deletions

View File

@@ -1,40 +1,45 @@
# Automatically generated by pytype. May contain errors.
# Python 2.7 ast
from typing import Any, Tuple, Generator
import typing
from typing import Any, Tuple, Iterator, Union
from _ast import (
AST, alias, arguments, boolop, cmpop, comprehension, excepthandler,
expr, expr_context, keyword, mod, operator, slice, stmt, unaryop, Add,
And, Assert, Assign, Attribute, AugAssign, AugLoad, AugStore, BinOp,
BitAnd, BitOr, BitXor, BoolOp, Break, Call, ClassDef, Compare, Continue,
Del, Delete, Dict, DictComp, Div, Ellipsis, Eq, ExceptHandler, Exec,
Expr, Expression, ExtSlice, FloorDiv, For, FunctionDef, GeneratorExp,
Global, Gt, GtE, If, IfExp, Import, ImportFrom, In, Index, Interactive,
Invert, Is, IsNot, LShift, Lambda, List, ListComp, Load, Lt, LtE, Mod,
Module, Mult, Name, Not, NotEq, NotIn, Num, Or, Param, Pass, Pow, Print,
RShift, Raise, Repr, Return, Set, SetComp, Slice, Store, Str, Sub,
Subscript, Suite, TryExcept, TryFinally, Tuple, UAdd, USub, UnaryOp,
While, With, Yield)
Add, alias, And, arguments, Assert, Assign, AST, Attribute, AugAssign,
AugLoad, AugStore, BinOp, BitAnd, BitOr, BitXor, BoolOp, boolop, Break,
Call, ClassDef, cmpop, Compare, comprehension, Continue, Del, Delete, Dict,
DictComp, Div, Ellipsis, Eq, ExceptHandler, Exec, Expr, expr, Expression,
expr_context, ExtSlice, FloorDiv, For, FunctionDef, GeneratorExp, Global,
Gt, GtE, If, IfExp, Import, ImportFrom, In, Index, Interactive, Invert, Is,
IsNot, keyword, Lambda, List, ListComp, Load, LShift, Lt, LtE, Mod, mod,
Module, Mult, Name, Not, NotEq, NotIn, Num, operator, Or, Param, Pass, Pow,
Print, Raise, Repr, Return, RShift, Set, SetComp, Slice, slice, stmt,
Store, Str, Sub, Subscript, Suite, TryExcept, TryFinally, Tuple, UAdd,
UnaryOp, unaryop, USub, While, With, Yield
)
__version__ = ... # type: int
__version__ = ... # type: str
PyCF_ONLY_AST = ... # type: int
def copy_location(new_node, old_node) -> Any: ...
def dump(node, *args, **kwargs) -> str: ...
def fix_missing_locations(node) -> Any: ...
def get_docstring(node, *args, **kwargs) -> Any: ...
def increment_lineno(node, *args, **kwargs) -> Any: ...
def iter_child_nodes(node) -> Generator[Any, Any, Any]: ...
def iter_fields(node) -> Any: ... # TODO: Generator[Tuple[Any, ...]]: ...
def literal_eval(node_or_string) -> Any: ...
def parse(source, filename = ..., mode = ..., *args, **kwargs) -> AST: ...
def walk(node) -> Any: ... # TODO: Generator[Any]: ...
class NodeVisitor(object):
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
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, AST]) -> Any: ...
def walk(node: AST) -> Iterator[AST]: ...
class NodeVisitor():
__doc__ = ... # type: str
def generic_visit(self, node) -> None: ...
def visit(self, node) -> Any: ...
def visit(self, node: AST) -> Any: ...
def generic_visit(self, node: AST) -> None: ...
class NodeTransformer(NodeVisitor):
__doc__ = ... # type: str
def generic_visit(self, node) -> Any: ...
def generic_visit(self, node: AST) -> None: ...