Refs #27546 -- Replaced hardcoded class name in ForNode.__repr__().

This commit is contained in:
Mads Jensen 2017-10-04 17:26:49 +02:00 committed by Tim Graham
parent 03da070f5c
commit ee7ab1b6e2
1 changed files with 7 additions and 3 deletions

View File

@ -143,9 +143,13 @@ class ForNode(Node):
def __repr__(self): def __repr__(self):
reversed_text = ' reversed' if self.is_reversed else '' reversed_text = ' reversed' if self.is_reversed else ''
return "<For Node: for %s in %s, tail_len: %d%s>" % \ return '<%s: for %s in %s, tail_len: %d%s>' % (
(', '.join(self.loopvars), self.sequence, len(self.nodelist_loop), self.__class__.__name__,
reversed_text) ', '.join(self.loopvars),
self.sequence,
len(self.nodelist_loop),
reversed_text,
)
def __iter__(self): def __iter__(self):
yield from self.nodelist_loop yield from self.nodelist_loop