Falsey Enums

Steve D'Aprano steve+python at pearwood.info
Thu Jul 27 22:15:20 EDT 2017


I has some Enums:

from enum import Enum
class X(Enum):
    Falsey = 0
    Truthy = 1
    Fakey = 2


and I want bool(X.Falsey) to be False, and the others to be True. What should I
do?


-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list