
Jan. 30, 2013
11:19 a.m.
On 01/30/2013 08:26 AM, Antoine Pitrou wrote:
Le Wed, Michael Foord a écrit :
With a Python 3 metaclass that provides default values for *looked up* entries you could have this:
class Color(Enum): RED, WHITE, BLUE
This relies on tuple evaluation order, and would also evaluate any other symbol looked up from inside the class body (which means I cannot add anything else than enum symbols to the class).
Probably a dumb question, but why would you want to add non-enum to an enum class? ~Ethan~