Vedran Čačić added the comment:
Absolutely. How the hell is `green = None` explicit?!
On the other hand, `class Color(Enum, style='declarative'):` is explicit.
People must learn something. Why then don't they learn the right thing instead
of "hey, assigning None inside enums magically does the right thing" - except
when it doesn't.
Just a hint of a nightmare scenario: you write a method decorator, but you
forget to return a value from it (happened to me more times than I care to
admit). Ooops, your method is now next member of your enum. Good luck debugging
that. :-O
In fact, what _is_ explicit, is this:
class Color(metaclass=Enum):
green = object()
yellow = object()
I could live with it. :-)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26988>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com