aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/enum.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index c28f3452a75..616b2eac150 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -476,6 +476,9 @@ class Enum(metaclass=EnumMeta):
def __str__(self):
return "%s.%s" % (self.__class__.__name__, self._name_)
+ def __bool__(self):
+ return bool(self._value_)
+
def __dir__(self):
added_behavior = [
m