diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2016-09-02 16:32:32 -0700 |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2016-09-02 16:32:32 -0700 |
commit | aaffa44e37af7aa449a6bd0cab5d7ba035b47aa1 (patch) | |
tree | 47e40d8c7bf25e3400b3deb15ae87b7651caf8d1 /Lib/enum.py | |
parent | 66c9c618217fe911751f4e77925bd77c91885c81 (diff) | |
download | cpython-aaffa44e37af7aa449a6bd0cab5d7ba035b47aa1.tar.gz |
issue23591: bool(empty_flags) == False; more docs & tests
Diffstat (limited to 'Lib/enum.py')
-rw-r--r-- | Lib/enum.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/enum.py b/Lib/enum.py index 8d23933d3e..1e028a364f 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -714,6 +714,9 @@ class Flag(Enum): '|'.join([str(m._name_ or m._value_) for m in members]), ) + def __bool__(self): + return bool(self._value_) + def __or__(self, other): if not isinstance(other, self.__class__): return NotImplemented |