John Belmonte <j...@neggie.net> added the comment:

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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38250>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to