Hello,
I'm using python 3.4.2 and pylint 1.5.2. Pylint is printing a
r:redefined-variable-type warning when I use a variable of type enum. The
following script demonstrates the problem:
from enum import Enum
class MyEnum(Enum):
Value1 = 1
Value2 = 2
myEnum = MyEnum.Value1
print("my enum is {}".format(myEnum))
# Huh? this line generates
# warning R0204: Redefinition of myEnum type from EnumRepro.MyEnum.Value1 to
# EnumRepro.MyEnum.Value2 [R:redefined-variable-type]
myEnum = MyEnum.Value2 # this generates
print("my enum is {}".format(myEnum))
Is this expected? At the moment I'm just disabling R0204 at the code locations
that produce the problem ... I'm new to python, so perhaps I'm just doing
something dim.
Thanks!
Eli
This e-mail is intended only for the use of the addressees. Any copying,
forwarding, printing or other use of this e-mail by persons other than the
addressees is not authorized. This e-mail may contain information that is
privileged, confidential and exempt from disclosure. If you are not the
intended recipient, please notify us immediately by return e-mail (including
the original message in your reply) and then delete and discard all copies of
the e-mail.
Thank you.
_______________________________________________
code-quality mailing list
[email protected]
https://mail.python.org/mailman/listinfo/code-quality