This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author veky
Recipients David Hagen, John Hagen, abarry, barry, eli.bendersky, ethan.furman, kennethreitz, python-dev, rhettinger, veky, vstinner
Date 2016-08-19.12:19:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471609170.1.0.143312838588.issue26988@psf.upfronthosting.co.za>
In-reply-to
Content
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. :-)
History
Date User Action Args
2016-08-19 12:19:30vekysetrecipients: + veky, barry, rhettinger, vstinner, eli.bendersky, ethan.furman, python-dev, abarry, John Hagen, David Hagen, kennethreitz
2016-08-19 12:19:30vekysetmessageid: <1471609170.1.0.143312838588.issue26988@psf.upfronthosting.co.za>
2016-08-19 12:19:30vekylinkissue26988 messages
2016-08-19 12:19:29vekycreate