Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Jul 2, 2024
1 parent 28952f2 commit c912e9f
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions qlasskit/ast2ast/constantfolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def arg_tr(arg):
if isinstance(arg, ast.Tuple) or isinstance(arg, ast.List):
elts = [self.visit(elt) for elt in arg.elts]
if all(isinstance(elt, ast.Constant) for elt in elts):
return ast.Constant(value=[elt.value for elt in elts])
return ast.Constant([elt.value for elt in elts])

return arg

Expand Down Expand Up @@ -132,15 +132,3 @@ def visit_IfExp(self, node):
if isinstance(node.test, ast.Constant):
return node.body if node.test.value else node.orelse
return node

# def visit_List(self, node):
# elts = [self.visit(elt) for elt in node.elts]
# if all(isinstance(elt, ast.Constant) for elt in elts):
# return ast.Constant(value=[elt.value for elt in elts])
# return ast.List(elts=elts, ctx=node.ctx)

# def visit_Tuple(self, node):
# elts = [self.visit(elt) for elt in node.elts]
# if all(isinstance(elt, ast.Constant) for elt in elts):
# return ast.Constant(value=tuple(elt.value for elt in elts))
# return ast.Tuple(elts=elts, ctx=node.ctx)

0 comments on commit c912e9f

Please sign in to comment.