
Feb. 1, 2013
3:12 a.m.
Am 30.01.2013 17:26, schrieb Antoine Pitrou:
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).
In other words, I'm afraid it would be somewhat fragile ;)
And it breaks static code checkers like pyflakes. Georg