diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2016-09-02 23:32:32 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2016-09-02 23:32:32 (GMT) |
commit | 25d94bbf05f37151e7e6e3a2e1cd5af4a3e5f68c (patch) | |
tree | 910a33c185d1f732a9a7545a3e9460672b10318e /Lib/enum.py | |
parent | 044395306702fc47e63b43d5ad961a127c19b262 (diff) | |
download | cpython-25d94bbf05f37151e7e6e3a2e1cd5af4a3e5f68c.zip cpython-25d94bbf05f37151e7e6e3a2e1cd5af4a3e5f68c.tar.gz cpython-25d94bbf05f37151e7e6e3a2e1cd5af4a3e5f68c.tar.bz2 |
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 8d23933..1e028a3 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 |