issue23591: bool(empty_flags) == False; more docs & tests

This commit is contained in:
Ethan Furman 2016-09-02 16:32:32 -07:00
parent 0443953067
commit 25d94bbf05
3 changed files with 78 additions and 3 deletions

View file

@ -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