diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-10-09 19:25:40 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-10-09 19:25:40 +0300 |
commit | d4395609c9e9454a1b18236626d8fe824fcc76aa (patch) | |
tree | 89198dac0ed63a916ce9ebb7d1df76293faeed9d /pylint | |
parent | 38341109991fcd0e84edce03b48641481327e42c (diff) | |
download | pylint-d4395609c9e9454a1b18236626d8fe824fcc76aa.tar.gz |
Use the any builtin, instead of evaluating the entire list of instance attributes.
Diffstat (limited to 'pylint')
-rw-r--r-- | pylint/checkers/base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index 30e337b..3029543 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -1194,7 +1194,7 @@ class NameChecker(_BasicChecker): def visit_classdef(self, node): self._check_name('class', node.name, node) for attr, anodes in six.iteritems(node.instance_attrs): - if not list(node.instance_attr_ancestors(attr)): + if not any(node.instance_attr_ancestors(attr)): self._check_name('attr', attr, anodes[0]) @check_messages('blacklisted-name', 'invalid-name') |