Really make rqlrewrite flake8 compliant 3.25
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 23 Mar 2017 11:47:59 +0100
branch3.25
changeset 12089 54b518367617
parent 12088 477a59a45786
child 12090 245a4f81053b
Really make rqlrewrite flake8 compliant
cubicweb/rqlrewrite.py
--- a/cubicweb/rqlrewrite.py	Wed Mar 22 14:18:54 2017 +0100
+++ b/cubicweb/rqlrewrite.py	Thu Mar 23 11:47:59 2017 +0100
@@ -164,6 +164,7 @@
                 aliases.append(n.VariableRef(colalias))
                 selected.add(vref.name)
 
+
 def _has_multiple_cardinality(etypes, rdef, ttypes_func, cardindex):
     """return True if relation definitions from entity types (`etypes`) to
     target types returned by the `ttypes_func` function all have single (1 or ?)
@@ -339,7 +340,7 @@
             myrqlst = select.copy(solutions=lchecksolutions)
             myunion.append(myrqlst)
             # in-place rewrite + annotation / simplification
-            lcheckdef = [({var: 'X'}, rqlexprs) for var, rqlexprs in lcheckdef]
+            lcheckdef = [({v: 'X'}, rqlexprs) for v, rqlexprs in lcheckdef]
             self.rewrite(myrqlst, lcheckdef, kwargs)
             _add_noinvariant(noinvariant, restricted, myrqlst, nbtrees)
         if () in localchecks:
@@ -683,7 +684,7 @@
                 variante.append((key, sol[newvar]))
             variantes.add(tuple(variante))
         # rebuild variantes as dict
-        variantes = [dict(variante) for variante in variantes]
+        variantes = [dict(v) for v in variantes]
         # remove variable which have always the same type
         for key in self.rewritten:
             it = iter(variantes)