diff --git a/.gitignore b/.gitignore index d7268703..266af5fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *_dis *~ +*.pyc /.cache /.eggs /.python-version diff --git a/uncompyle6/parsers/astnode.py b/uncompyle6/parsers/astnode.py index 30fac7f7..1a112e73 100644 --- a/uncompyle6/parsers/astnode.py +++ b/uncompyle6/parsers/astnode.py @@ -34,5 +34,9 @@ class AST(UserList): def __repr__(self, indent=''): rv = str(self.type) for k in self: - rv = rv + '\n' + str(k).replace('\n', '\n ') + child_text = str(k).replace('\n', '\n ') + if hasattr(k, '__len__'): + rv += '\n(%d) %s' % (len(k), child_text) + else: + rv += '\n' + child_text return rv