summaryrefslogtreecommitdiff
path: root/checkers/classes.py
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2014-04-09 11:34:20 +0300
committercpopa <devnull@localhost>2014-04-09 11:34:20 +0300
commit72d714b3af0d5264d0f06f8567274235d12dcace (patch)
treedaef0d6364ece31dcdc24c70c9c4276307346ce7 /checkers/classes.py
parentf45cab1b0f8541d6ff2fe39b72090ad9e6613c0e (diff)
downloadpylint-72d714b3af0d5264d0f06f8567274235d12dcace.tar.gz
Remove empty-slots-object, define tuple with methods at the global level.
Diffstat (limited to 'checkers/classes.py')
-rw-r--r--checkers/classes.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/checkers/classes.py b/checkers/classes.py
index 8242162..85a8507 100644
--- a/checkers/classes.py
+++ b/checkers/classes.py
@@ -30,6 +30,7 @@ if sys.version_info >= (3, 0):
NEXT_METHOD = '__next__'
else:
NEXT_METHOD = 'next'
+ITER_METHODS = ('__iter__', '__getitem__')
def class_is_abstract(node):
"""return true if the given class node should be considered as an abstract
@@ -347,7 +348,7 @@ a metaclass class method.'}
return
for slots in node.igetattr('__slots__'):
# check if __slots__ is a valid type
- for meth in ('__iter__', '__getitem__'):
+ for meth in ITER_METHODS:
try:
slots.getattr(meth)
break