[New-bugs-announce] [issue26748] enum.Enum is False-y

Antoine Pitrou report at bugs.python.org
Wed Apr 13 13:22:01 EDT 2016


New submission from Antoine Pitrou:

>>> import enum
>>> bool(enum.Enum)
False
>>> bool(enum.IntEnum)
False

This behaviour is relatively unexpected for classes, and can lead to subtle bugs such as the following:

https://bitbucket.org/ambv/singledispatch/issues/8/inconsistent-hierarchy-with-enum

----------
components: Library (Lib)
messages: 263342
nosy: barry, eli.bendersky, ethan.furman, gvanrossum, pitrou
priority: normal
severity: normal
status: open
title: enum.Enum is False-y
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26748>
_______________________________________


More information about the New-bugs-announce mailing list