summaryrefslogtreecommitdiff
path: root/pylint/checkers
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-11-25 11:26:52 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-11-25 11:26:52 +0200
commit5b7deb7654ea35b1384f8a9398c18fb7466133c6 (patch)
tree2042cac8222980914dfd5f6f6625ba4de27d0a4e /pylint/checkers
parent886c03cf2ac8758519dfd50c12b486d76d231d0d (diff)
downloadpylint-5b7deb7654ea35b1384f8a9398c18fb7466133c6.tar.gz
Fix instances of unneeded-not in pylint's codebase.
Diffstat (limited to 'pylint/checkers')
-rw-r--r--pylint/checkers/classes.py2
-rw-r--r--pylint/checkers/imports.py2
-rw-r--r--pylint/checkers/utils.py2
-rw-r--r--pylint/checkers/variables.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py
index 6763f74..e79cf97 100644
--- a/pylint/checkers/classes.py
+++ b/pylint/checkers/classes.py
@@ -570,7 +570,7 @@ a metaclass class method.'}
return
class_node = node.parent.frame()
if (self._meth_could_be_func and node.type == 'method'
- and not node.name in PYMETHODS
+ and node.name not in PYMETHODS
and not (node.is_abstract() or
overrides_a_method(class_node, node.name) or
decorated_with_property(node) or
diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py
index 0be2b2c..59c6ed0 100644
--- a/pylint/checkers/imports.py
+++ b/pylint/checkers/imports.py
@@ -372,7 +372,7 @@ given file (report RP0402 must not be disabled)'}
# handle dependencies
importedmodnames = self.stats['dependencies'].setdefault(
importedmodname, set())
- if not context_name in importedmodnames:
+ if context_name not in importedmodnames:
importedmodnames.add(context_name)
# update import graph
mgraph = self.import_graph[context_name]
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py
index b85c237..cfb20d7 100644
--- a/pylint/checkers/utils.py
+++ b/pylint/checkers/utils.py
@@ -382,7 +382,7 @@ def is_attr_protected(attrname):
"""return True if attribute name is protected (start with _ and some other
details), False otherwise.
"""
- return attrname[0] == '_' and not attrname == '_' and not (
+ return attrname[0] == '_' and attrname != '_' and not (
attrname.startswith('__') and attrname.endswith('__'))
def node_frame_class(node):
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index f0f0fa0..cde66eb 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -729,7 +729,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
assign = astmts[0].assign_type()
if (isinstance(assign, (astroid.For, astroid.Comprehension,
astroid.GeneratorExp))
- and not assign.statement() is node.statement()):
+ and assign.statement() is not node.statement()):
self.add_message('undefined-loop-variable', args=name, node=node)
@check_messages('redefine-in-handler')