Skip to content

Commit c6a2039

Browse files
committed
make treetransform implement abstract visitor
1 parent d43a606 commit c6a2039

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mypy/strconv.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
from mypy.util import short_type, IdMapper
99
import mypy.nodes
10-
from mypy.visitor import NodeVisitor
10+
from mypy.visitor import AbstractNodeVisitor
1111

1212

13-
class StrConv(NodeVisitor[str]):
13+
class StrConv(AbstractNodeVisitor[str]):
1414
"""Visitor for converting a node to a human-readable string.
1515
1616
For example, an MypyFile node from program '1' is converted into
@@ -503,6 +503,9 @@ def visit_slice_expr(self, o: 'mypy.nodes.SliceExpr') -> str:
503503
def visit_backquote_expr(self, o: 'mypy.nodes.BackquoteExpr') -> str:
504504
return self.dump([o.expr], o)
505505

506+
def visit_temp_node(self, o: 'mypy.nodes.TempNode') -> str:
507+
return self.dump([o.type], o)
508+
506509

507510
def dump_tagged(nodes: Sequence[object], tag: str, str_conv: 'StrConv') -> str:
508511
"""Convert an array into a pretty-printed multiline string representation.

0 commit comments

Comments
 (0)