You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
print AST children counts for internal nodes
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user