def visit_Assign(self, node):
for target in node.targets:
if(isinstance(target,ast.Tuple)):#this is to handle variables declared on the same line
for el in target.elts:
self.grabVar(el)
else:
self.grabVar(target)
ast.NodeVisitor.generic_visit(self, node)#Make sure to run the original method so the AST module can do its thing
评论列表
文章目录