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 serhiy.storchaka
Recipients ethan.furman, novas0x2a, r.david.murray, serhiy.storchaka
Date 2015-08-11.05:41:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439271675.0.0.731712062228.issue24840@psf.upfronthosting.co.za>
In-reply-to
Content
This looks to me as very special case. Enum doesn't delegates the __bool__ method as well as it doesn't delegates __float__, __lt__, __len__, etc. It is left to user to add these methods if needed.

It is easy to add the __bool__ method to user enum. In your case you also can inherit from IntEnum.

>>> class Bool(IntEnum):
...     Yep = True
...     Nope = False
... 
>>> bool(Bool.Yep)
True
>>> bool(Bool.Nope)
False
History
Date User Action Args
2015-08-11 05:41:15serhiy.storchakasetrecipients: + serhiy.storchaka, r.david.murray, ethan.furman, novas0x2a
2015-08-11 05:41:14serhiy.storchakasetmessageid: <1439271675.0.0.731712062228.issue24840@psf.upfronthosting.co.za>
2015-08-11 05:41:14serhiy.storchakalinkissue24840 messages
2015-08-11 05:41:14serhiy.storchakacreate