Created
February 23, 2017 19:13
-
-
Save imankulov/1ea14fb895f5eacdae968683ea219075 to your computer and use it in GitHub Desktop.
Workaround for broken "foo AND NOT bar" logic in bitmapist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> bitmapist.mark_unique('foo', 1) | |
>>> bitmapist.mark_unique('foo', 1000) | |
>>> bitmapist.mark_unique('bar', 1) | |
>>> list(bitmapist.UniqueEvents('foo') & ~bitmapist.UniqueEvents('bar')) | |
[] | |
>>> list(bitmapist.UniqueEvents('foo') ^ bitmapist.UniqueEvents('bar') & bitmapist.UniqueEvents('foo')) | |
[1000] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expressions of type
a AND NOT b
don't work as expected in bitmapist, because b may not be of the same size as a. The thing is,a AND NOT b
is an equivalent fora XOR b AND a
which works just fine.