I'm using this version of pylint:
pylint 1.3.1,
astroid 1.2.1, common 0.62.0
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
When I run pylint over the code below I get the error message: "E: 9, 0:
Instance of 'MY_ENUM' has no 'blah' member (no-member)".
class Enumeration(object):
def __init__(self, name, enum_list):
pass
def blah(self):
pass
my_enum = Enumeration('MY_ENUM', [("disable", 0), ("enable", 1)])
my_enum.blah()
I can fix this error by enclosing [("disable", 0), ("enable", 1)] inside a
list() or tuple(). In other words, the following fixes the problem:
my_enum = Enumeration('MY_ENUM', *list*([("disable", 0), ("enable", 1)]))
Any thoughts?
Thanks,
Martin