Raymond Hettinger added the comment: > Any problems with: > > class Color(Enum): # or Color(Flag) > red = _auto_ > green = _auto_ > blue = _auto_
As long as _auto_ has been defined somewhere (i.e. from enum import _auto_), it is normal Python and doesn't fight with the rest of language or its toolchains. The idea does seem to be at odds with the enum module itself. Heretofore, the rule for the module is that if the same object is assigned to multiple variable names, those names become synonyms. >>> from enum import Enum >>> class Color(Enum): red = 1 magenta = 1 orange = 2 ochre = 2 >>> Color.orange is Color.ochre True Also, I still question the need, you already have multiple ways to do it: Color = Enum('Color', ['red', 'green', 'blue']) Color = Enum('Color', ''' red green blue ''') ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23591> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com