Message378552
It's completely undocumented, but today I noticed that Flag.__contains__() is actually a subset operation.
def __contains__(self, other):
...
return other._value_ & self._value_ == other._value_
It's an unfortunate departure from the `set` type, which uses `in` for membership test and issubset() / `<=` for subset test.
For set operations, the Flag individual bits should be considered the members of a set (not Flag compound values, which are themselves equivalent to a set). |
|
Date |
User |
Action |
Args |
2020-10-13 10:13:12 | John Belmonte | set | recipients:
+ John Belmonte, ethan.furman, veky, Manjusaka |
2020-10-13 10:13:12 | John Belmonte | set | messageid: <1602583992.36.0.864256588446.issue38250@roundup.psfhosted.org> |
2020-10-13 10:13:12 | John Belmonte | link | issue38250 messages |
2020-10-13 10:13:11 | John Belmonte | create | |
|