This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author John Belmonte
Recipients John Belmonte, Manjusaka, ethan.furman, veky
Date 2020-10-13.10:13:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602583992.36.0.864256588446.issue38250@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2020-10-13 10:13:12John Belmontesetrecipients: + John Belmonte, ethan.furman, veky, Manjusaka
2020-10-13 10:13:12John Belmontesetmessageid: <1602583992.36.0.864256588446.issue38250@roundup.psfhosted.org>
2020-10-13 10:13:12John Belmontelinkissue38250 messages
2020-10-13 10:13:11John Belmontecreate