Skip to content

Commit 900835b

Browse files
author
Guido van Rossum
committed
Fix some types
1 parent 76c7961 commit 900835b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mypy/fastparse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
USub,
6464
)
6565
def ast3_parse(source: Union[str, bytes], filename: str, mode: str,
66-
feature_version: int = sys.version_info[1]) -> ast3.Module:
66+
feature_version: int = sys.version_info[1]) -> AST:
6767
return ast3.parse(source, filename, mode,
6868
type_comments=True, # This works the magic
6969
feature_version=feature_version)
@@ -89,7 +89,7 @@ def ast3_parse(source: Union[str, bytes], filename: str, mode: str,
8989
USub,
9090
)
9191
def ast3_parse(source: Union[str, bytes], filename: str, mode: str,
92-
feature_version: int = sys.version_info[1]) -> ast3.AST:
92+
feature_version: int = sys.version_info[1]) -> AST:
9393
return ast3.parse(source, filename, mode, feature_version=feature_version)
9494
# These doesn't exist before 3.8
9595
NamedExpr = Any
@@ -1328,7 +1328,7 @@ def visit_UnaryOp(self, n: UnaryOp) -> Type:
13281328
def visit_Num(self, n: Num) -> Type:
13291329
return self.numeric_type(n.n, n)
13301330

1331-
def numeric_type(self, value: object, n: Node) -> Type:
1331+
def numeric_type(self, value: object, n: AST) -> Type:
13321332
# The node's field has the type complex, but complex isn't *really*
13331333
# a parent of int and float, and this causes isinstance below
13341334
# to think that the complex branch is always picked. Avoid

0 commit comments

Comments
 (0)