This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Robert Gomułka
Recipients Robert Gomułka, barry, eli.bendersky, ethan.furman
Date 2017-09-26.09:52:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506419525.08.0.712223716255.issue31587@psf.upfronthosting.co.za>
In-reply-to
Content
It turns out that enum34 backports module was the culprit (it was first on search path). When using enum native module, everything works as expected:

> c:\Python\Python36-32\python.exe -I
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import enum
>>> enum
<module 'enum' from 'c:\\Python\\Python36-32\\lib\\enum.py'>
>>> @enum.unique
... class A(enum.IntEnum):
...     a = 1
...     name = 2
...     value = 3
...
>>> exit()

> c:\Python\Python36-32\python.exe
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import enum
>>> enum
<module 'enum' from 'C:\\Python27\\Lib\\site-packages\\enum\\__init__.py'>
>>> @enum.unique
... class A(enum.IntEnum):
...     a = 1
...     name = 2
...     value = 3
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "C:\Python27\Lib\site-packages\enum\__init__.py", line 835, in unique
    (enumeration, duplicate_names)
ValueError: duplicate names found in <enum 'A'>: a -> A.name, name -> A.name, value -> A.name

Sorry for the noise.
History
Date User Action Args
2017-09-26 09:52:05Robert Gomułkasetrecipients: + Robert Gomułka, barry, eli.bendersky, ethan.furman
2017-09-26 09:52:05Robert Gomułkasetmessageid: <1506419525.08.0.712223716255.issue31587@psf.upfronthosting.co.za>
2017-09-26 09:52:05Robert Gomułkalinkissue31587 messages
2017-09-26 09:52:05Robert Gomułkacreate