Skip to content

Commit 8448783

Browse files
JukkaLx612skm
authored andcommitted
Include fullname in Var repr (python#18632)
This makes debugging easier.
1 parent c09efa9 commit 8448783

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)