Skip to content

Commit 20e17ee

Browse files
committed
Fix tests
1 parent ae5771e commit 20e17ee

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

mypy/fastparse.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,14 @@ def visit(self, node: ast3.expr) -> ProperType: ...
13191319
@overload
13201320
def visit(self, node: Optional[AST]) -> Optional[ProperType]: ...
13211321

1322+
@overload
1323+
def visit(self, node: ast3.expr,
1324+
is_type_comment: Optional[bool]) -> ProperType: ...
1325+
1326+
@overload
1327+
def visit(self, node: Optional[AST],
1328+
is_type_comment: Optional[bool]) -> Optional[ProperType]: ...
1329+
13221330
def visit(self, node: Optional[AST],
13231331
is_type_comment: Optional[bool] = False) -> Optional[ProperType]:
13241332
"""Modified visit -- keep track of the stack of nodes"""
@@ -1426,7 +1434,7 @@ def _extract_argument_name(self, n: ast3.expr) -> Optional[str]:
14261434
def visit_Name(self, n: Name) -> Type:
14271435
return UnboundType(n.id, line=self.line, column=self.convert_column(n.col_offset))
14281436

1429-
def visit_BinOp(self, n: ast3.BinOp, is_type_comment: Optional[bool] = False) -> Type:
1437+
def visit_BinOp(self, n: ast3.BinOp, is_type_comment: bool = False) -> Type:
14301438
if not isinstance(n.op, ast3.BitOr):
14311439
return self.invalid_type(n)
14321440

mypy/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,9 +1719,9 @@ def serialize(self) -> JsonDict:
17191719
assert False, "Synthetic types don't serialize"
17201720

17211721

1722-
class Pep604Syntax(NamedTuple):
1723-
uses_pep_604_syntax: bool
1724-
is_type_comment: bool
1722+
Pep604Syntax = NamedTuple('Pep604Syntax', [
1723+
('uses_pep_604_syntax', bool),
1724+
('is_type_comment', bool)])
17251725

17261726

17271727
class UnionType(ProperType):

0 commit comments

Comments
 (0)