summaryrefslogtreecommitdiff
path: root/pylint/checkers/classes.py
diff options
context:
space:
mode:
authorLaura Médioni <laura.medioni@logilab.fr>2015-10-29 14:43:10 +0100
committerLaura Médioni <laura.medioni@logilab.fr>2015-10-29 14:43:10 +0100
commit5d34bbb1694862df673b42a8f87e33d188efdb31 (patch)
tree35e7a0ea00660281678d5bbab74218495e86ed5a /pylint/checkers/classes.py
parentf1d1b02dd4279d54e8b11e508fd8e4f554392478 (diff)
downloadpylint-git-5d34bbb1694862df673b42a8f87e33d188efdb31.tar.gz
improve style and fix typos regarding no_class/staticmethod_decorator
Diffstat (limited to 'pylint/checkers/classes.py')
-rw-r--r--pylint/checkers/classes.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py
index ee3c9852c..d12f45d03 100644
--- a/pylint/checkers/classes.py
+++ b/pylint/checkers/classes.py
@@ -633,8 +633,9 @@ a metaclass class method.'}
self._check_protected_attribute_access(node)
def _check_classmethod_declaration(self, node):
- """checks for uses of classmethod() instead of @classmethod decorator
+ """Checks for uses of classmethod() or staticmethod()
+ When a @classmethod or @staticmethod decorator should be used instead.
A message will be emitted only if the assignment is at a class scope
and only if the classmethod's argument belongs to the class where it
is defined.
@@ -645,7 +646,7 @@ a metaclass class method.'}
# check the function called is "classmethod" or "staticmethod"
func = node.value.func
if (not isinstance(func, astroid.Name) or
- func.name not in('classmethod', 'staticmethod')):
+ func.name not in ('classmethod', 'staticmethod')):
return
msg = ('no-classmethod-decorator' if func.name == 'classmethod' else
'no-staticmethod-decorator')