On Jul 18, 2016, at 08:17 AM, Ethan Furman wrote:
Take the name "NewYear": if it had been a global constant I would have named it "NEWYEAR"; if it had been a normal class attribute I would have named it "new_year"; however, being an Enum member, it is neither of those things.
Since in my code at least, I always include the enum class name at the call site, underscore_words for enum members is just fine.
class Action(Enum): hold = 0 reject = 1 discard = 2 accept = 3 defer = 4
if action in (Action.defer, Action.hold): # ... elif action is Action.discard: # ... elif action is Action.reject: # ... elif action is Action.accept: # ...
and so on. Make the code less shifty :).