You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +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
|
*_dis
|
||||||
*~
|
*~
|
||||||
|
*.pyc
|
||||||
/.cache
|
/.cache
|
||||||
/.eggs
|
/.eggs
|
||||||
/.python-version
|
/.python-version
|
||||||
|
@@ -34,5 +34,9 @@ class AST(UserList):
|
|||||||
def __repr__(self, indent=''):
|
def __repr__(self, indent=''):
|
||||||
rv = str(self.type)
|
rv = str(self.type)
|
||||||
for k in self:
|
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
|
return rv
|
||||||
|
Reference in New Issue
Block a user