# HG changeset patch # User Denis Laxalde # Date 1490266079 -3600 # Node ID 54b518367617814974a618bd0138ef70fd3f60c5 # Parent 477a59a457865835a36588a7505046c2036e2c0d Really make rqlrewrite flake8 compliant diff -r 477a59a45786 -r 54b518367617 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)