[issue31587] Enum doesn't allow name

2017-09-26 Thread Robert Gomułka
Robert Gomułka added the comment: 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

[issue31587] Enum doesn't allow name

2017-09-26 Thread Robert Gomułka
Robert Gomułka added the comment: As a workaround, one can: 1. Rename the fields to not use name/value names 2. Use Enum instead of IntEnum, which somehow doesn't have this bug. -- ___ Python tracker _

[issue31587] Enum doesn't allow name

2017-09-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +barry, eli.bendersky, ethan.furman versions: +Python 3.7 ___ Python tracker ___ ___ Python-bu

[issue31587] Enum doesn't allow name

2017-09-25 Thread Robert Gomułka
New submission from Robert Gomułka: Enum module handles "name" member incorrectly. 1. "name" can't be used as a member when decorated with unique: >>> import enum >>> @enum.unique ... class A(enum.IntEnum): ... a = 1 ... name = 2 ... Traceback (most recent call last): File "", line 2,