You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
print AST children counts for internal nodes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
*_dis
|
||||
*~
|
||||
*.pyc
|
||||
/.cache
|
||||
/.eggs
|
||||
/.python-version
|
||||
|
@@ -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