mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
issue23591: bool(empty_flags) == False; more docs & tests
This commit is contained in:
parent
0443953067
commit
25d94bbf05
3 changed files with 78 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue