Skip to content

Commit 52dd490

Browse files
ddfishergvanrossum
authored andcommitted
Update typed_ast for version 1.0 (#931)
1 parent a778704 commit 52dd490

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

third_party/3/typed_ast/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# This module is a fork of the CPython 2.7 and 3.5 ast modules with PEP 484 support.
2-
# See: https://github.com/dropbox/typed_ast
1+
# This module is a fork of the CPython 2 and 3 ast modules with PEP 484 support.
2+
# See: https://github.com/python/typed_ast

third_party/3/typed_ast/ast35.pyi renamed to third_party/3/typed_ast/ast3.pyi

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ class NodeVisitor():
88
class NodeTransformer(NodeVisitor):
99
def generic_visit(self, node: AST) -> None: ...
1010

11-
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
11+
def parse(source: Union[str, bytes],
12+
filename: Union[str, bytes] = ...,
13+
mode: str = ...,
14+
feature_version: int = ...) -> AST: ...
1215
def copy_location(new_node: AST, old_node: AST) -> AST: ...
1316
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
1417
def fix_missing_locations(node: AST) -> AST: ...
@@ -86,15 +89,20 @@ class Delete(stmt):
8689

8790
class Assign(stmt):
8891
targets = ... # type: typing.List[expr]
89-
value = ... # type: Optional[expr]
92+
value = ... # type: expr
9093
type_comment = ... # type: Optional[str]
91-
annotation = ... # type: Optional[expr]
9294

9395
class AugAssign(stmt):
9496
target = ... # type: expr
9597
op = ... # type: operator
9698
value = ... # type: expr
9799

100+
class AnnAssign(stmt):
101+
target = ... # type: expr
102+
annotation = ... # type: expr
103+
value = ... # type: Optional[expr]
104+
simple = ... # type: int
105+
98106
class For(stmt):
99107
target = ... # type: expr
100108
iter = ... # type: expr
@@ -107,6 +115,7 @@ class AsyncFor(stmt):
107115
iter = ... # type: expr
108116
body = ... # type: typing.List[stmt]
109117
orelse = ... # type: typing.List[stmt]
118+
type_comment = ... # type: Optional[str]
110119

111120
class While(stmt):
112121
test = ... # type: expr
@@ -126,6 +135,7 @@ class With(stmt):
126135
class AsyncWith(stmt):
127136
items = ... # type: typing.List[withitem]
128137
body = ... # type: typing.List[stmt]
138+
type_comment = ... # type: Optional[str]
129139

130140
class Raise(stmt):
131141
exc = ... # type: Optional[expr]
@@ -255,6 +265,14 @@ class Num(expr):
255265
class Str(expr):
256266
s = ... # type: str
257267

268+
class FormattedValue(expr):
269+
value = ... # type: expr
270+
conversion = ... # type: typing.Optional[int]
271+
format_spec = ... # type: typing.Optional[expr]
272+
273+
class JoinedStr(expr):
274+
values = ... # type: typing.List[expr]
275+
258276
class Bytes(expr):
259277
s = ... # type: bytes
260278

@@ -351,6 +369,7 @@ class comprehension(AST):
351369
target = ... # type: expr
352370
iter = ... # type: expr
353371
ifs = ... # type: typing.List[expr]
372+
is_async = ... # type: int
354373

355374

356375
class ExceptHandler(AST):
@@ -374,6 +393,7 @@ class arg(AST):
374393
annotation = ... # type: Optional[expr]
375394
lineno = ... # type: int
376395
col_offset = ... # type: int
396+
type_comment = ... # type: typing.Optional[str]
377397

378398
class keyword(AST):
379399
arg = ... # type: Optional[identifier]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from . import ast27
2-
from . import ast35
2+
from . import ast3
33

4-
def py2to3(ast: ast27.AST) -> ast35.AST: ...
4+
def py2to3(ast: ast27.AST) -> ast3.AST: ...

0 commit comments

Comments
 (0)