Skip to content

Commit dd6df2e

Browse files
authored
Include fullname in Var repr (#18632)
This makes debugging easier.
1 parent 75b5604 commit dd6df2e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/nodes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@ def name(self) -> str:
10731073
def fullname(self) -> str:
10741074
return self._fullname
10751075

1076+
def __repr__(self) -> str:
1077+
return f"<Var {self.fullname!r} at {hex(id(self))}>"
1078+
10761079
def accept(self, visitor: NodeVisitor[T]) -> T:
10771080
return visitor.visit_var(self)
10781081

0 commit comments

Comments
 (0)