flake8: fix E714 test for object identity should be 'is not'
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Wed, 13 Feb 2019 17:27:26 +0100
changeset 850 38337bfadfb7
parent 849 c54a59621062
child 851 ddf078af91d8
flake8: fix E714 test for object identity should be 'is not'
rql/__init__.py
rql/base.py
--- a/rql/__init__.py	Wed Feb 13 17:25:37 2019 +0100
+++ b/rql/__init__.py	Wed Feb 13 17:27:26 2019 +0100
@@ -149,7 +149,7 @@
                     rel = vref.relation()
                     if rel is None:
                         term = vref
-                        while not term.parent is select:
+                        while term.parent is not select:
                             term = term.parent
                         if any(term.is_equivalent(t) for t in select.selection):
                             rhs = copy_uid_node(select, rhs, vconsts)
--- a/rql/base.py	Wed Feb 13 17:25:37 2019 +0100
+++ b/rql/base.py	Wed Feb 13 17:27:26 2019 +0100
@@ -99,7 +99,7 @@
                 stack += node.children
 
     def is_equivalent(self, other):
-        if not other.__class__ is self.__class__:
+        if other.__class__ is not self.__class__:
             return False
         for i, child in enumerate(self.children):
             try:
@@ -175,9 +175,9 @@
 
     def __init__(self, lhs=None, rhs=None):
         Node.__init__(self)
-        if not lhs is None:
+        if lhs is not None:
             self.append(lhs)
-        if not rhs is None:
+        if rhs is not None:
             self.append(rhs)
 
     def remove(self, child):