diff options
author | Dmitry Pribysh <dmand@yandex.ru> | 2015-10-27 18:03:15 +0300 |
---|---|---|
committer | Dmitry Pribysh <dmand@yandex.ru> | 2015-10-27 18:03:15 +0300 |
commit | 4f85cfbec5bd5576754274adb351116e164bc19a (patch) | |
tree | ad255a14205ddfcdbfbc1a56c768bf467ab5153c /pylint/checkers/utils.py | |
parent | 328f24b72197c1a8ac22a58357f67740d6e1dd94 (diff) | |
download | pylint-4f85cfbec5bd5576754274adb351116e164bc19a.tar.gz |
Make iterable checker skip classes that are inferred to be abstractfix-685
Diffstat (limited to 'pylint/checkers/utils.py')
-rw-r--r-- | pylint/checkers/utils.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 443e32d..8873d0e 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -573,6 +573,17 @@ def node_ignores_exception(node, exception): return False +def class_is_abstract(node): + """return true if the given class node should be considered as an abstract + class + """ + for method in node.methods(): + if method.parent.frame() is node: + if method.is_abstract(pass_is_abstract=False): + return True + return False + + # TODO(cpopa): deprecate these or leave them as aliases? safe_infer = astroid.helpers.safe_infer has_known_bases = astroid.helpers.has_known_bases |