Serhiy Storchaka added the comment: 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 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24840> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com