I am facing an issue with Pylint duplicate-code warning and need some help.
I want to disable the duplicate-code warning because I expect some pieces of code to be duplicated, but I am unable to suppress the pylint warning.
Still now I have tried # pylint: disable=duplicate-code.
Thanks in advance
I'm using this version of pylint:
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)".
def __init__(self, name, enum_list):
my_enum = Enumeration('MY_ENUM', [("disable", 0), ("enable", 1)])
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)]))