Lichen

Changeset

836:0cac8b718fdc
2018-07-03 Paul Boddie raw files shortlog changelog graph Employ __get_single_item__ invocations when unpacking sequences. tuple-optimisations
common.py (file)
     1.1 --- a/common.py	Mon Jul 02 19:19:54 2018 +0200
     1.2 +++ b/common.py	Tue Jul 03 15:58:44 2018 +0200
     1.3 @@ -461,8 +461,9 @@
     1.4  
     1.5          for i, node in enumerate(n.nodes):
     1.6              statements.append(
     1.7 -                compiler.ast.Assign([node], compiler.ast.Subscript(
     1.8 -                    compiler.ast.Name(temp), "OP_APPLY", [compiler.ast.Const(i, str(i))]))
     1.9 +                compiler.ast.Assign([node], compiler.ast.CallFunc(
    1.10 +                    compiler.ast.Getattr(compiler.ast.Name(temp), "__get_single_item__"),
    1.11 +                    [compiler.ast.Const(i, str(i))]))
    1.12                  )
    1.13  
    1.14          return self.process_structure_node(compiler.ast.Stmt(statements))