python 3.x - pylint generates r:redefined-variable-type when using enums? -


i'm using python 3.4.2 , pylint 1.5.2. pylint printing r:redefined-variable-type warning when use variable of type enum. following script demonstrates problem:

enumrepro.py:

from enum import enum  class myenum(enum):     value1 = 1 value2 = 2  myenum = myenum.value1 print("my enum {}".format(myenum))  # huh? line generates # warning r0204: redefinition of myenum type enumrepro.myenum.value1  # enumrepro.myenum.value2 [r:redefined-variable-type] myenum = myenum.value2 # generates  print("my enum {}".format(myenum)) 

any suggestions? currently, i'm spot-disabling r0204 whenever use enums, that's not ideal.

thanks!

this problem pylint (enums , r0204 in general). multiple issues reported, e.g. https://github.com/pycqa/pylint/issues/781

thus, spot- or disabling r0204 moment fine.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -