Use repr() for the Whitespace repr

This makes whitespace appear as <Whitespace: '\n'> instead of <Whitespace:
>.
This commit is contained in:
Aaron Meurer
2015-05-05 19:00:25 -05:00
parent 93500c3f72
commit 2d75efff2a

View File

@@ -248,6 +248,10 @@ class LeafWithNewLines(Leaf):
return end_pos_line, end_pos_col
@utf8_repr
def __repr__(self):
return "<%s: %r>" % (type(self).__name__, self.value)
class Whitespace(LeafWithNewLines):
"""Contains NEWLINE and ENDMARKER tokens."""
__slots__ = ()