Update typed_ast for version 1.0 (#931)

This commit is contained in:
David Fisher
2017-02-13 07:26:45 -08:00
committed by Guido van Rossum
parent a778704b30
commit 52dd4903d1
3 changed files with 27 additions and 7 deletions

View File

@@ -1,2 +1,2 @@
# This module is a fork of the CPython 2.7 and 3.5 ast modules with PEP 484 support.
# See: https://github.com/dropbox/typed_ast
# This module is a fork of the CPython 2 and 3 ast modules with PEP 484 support.
# See: https://github.com/python/typed_ast

View File

@@ -8,7 +8,10 @@ class NodeVisitor():
class NodeTransformer(NodeVisitor):
def generic_visit(self, node: AST) -> None: ...
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
def parse(source: Union[str, bytes],
filename: Union[str, bytes] = ...,
mode: str = ...,
feature_version: int = ...) -> 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: ...
@@ -86,15 +89,20 @@ class Delete(stmt):
class Assign(stmt):
targets = ... # type: typing.List[expr]
value = ... # type: Optional[expr]
value = ... # type: expr
type_comment = ... # type: Optional[str]
annotation = ... # type: Optional[expr]
class AugAssign(stmt):
target = ... # type: expr
op = ... # type: operator
value = ... # type: expr
class AnnAssign(stmt):
target = ... # type: expr
annotation = ... # type: expr
value = ... # type: Optional[expr]
simple = ... # type: int
class For(stmt):
target = ... # type: expr
iter = ... # type: expr
@@ -107,6 +115,7 @@ class AsyncFor(stmt):
iter = ... # type: expr
body = ... # type: typing.List[stmt]
orelse = ... # type: typing.List[stmt]
type_comment = ... # type: Optional[str]
class While(stmt):
test = ... # type: expr
@@ -126,6 +135,7 @@ class With(stmt):
class AsyncWith(stmt):
items = ... # type: typing.List[withitem]
body = ... # type: typing.List[stmt]
type_comment = ... # type: Optional[str]
class Raise(stmt):
exc = ... # type: Optional[expr]
@@ -255,6 +265,14 @@ class Num(expr):
class Str(expr):
s = ... # type: str
class FormattedValue(expr):
value = ... # type: expr
conversion = ... # type: typing.Optional[int]
format_spec = ... # type: typing.Optional[expr]
class JoinedStr(expr):
values = ... # type: typing.List[expr]
class Bytes(expr):
s = ... # type: bytes
@@ -351,6 +369,7 @@ class comprehension(AST):
target = ... # type: expr
iter = ... # type: expr
ifs = ... # type: typing.List[expr]
is_async = ... # type: int
class ExceptHandler(AST):
@@ -374,6 +393,7 @@ class arg(AST):
annotation = ... # type: Optional[expr]
lineno = ... # type: int
col_offset = ... # type: int
type_comment = ... # type: typing.Optional[str]
class keyword(AST):
arg = ... # type: Optional[identifier]

View File

@@ -1,4 +1,4 @@
from . import ast27
from . import ast35
from . import ast3
def py2to3(ast: ast27.AST) -> ast35.AST: ...
def py2to3(ast: ast27.AST) -> ast3.AST: ...