Enums: making a single enum

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat May 26 00:46:50 EDT 2018


Am I silly for wanting to make a single enum?
I have a three-state flag, True, False or Maybe. Is is confusing or bad 
practice to make a single enum for the Maybe case?
from enum import Enum
class State(Enum):
 Maybe = 2
Maybe = State.Maybe
del State
Is there a better way of handling a three-state flag like this?
-- 
Steve


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /