-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make pickleable and allow data_array to be retrieved and set #44
Conversation
Hi @stevesimmons, thanks a lot for your contribution! I will see if I have a bit of time during this week to have a look at this. |
if (data) { | ||
memcpy(array->vector, data, num_bits / 8); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this to below the if (!array)
check?
else: | ||
# Warning! Only works reliably for objects whose hash is based on value not memory address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, this basically means:
class KlassX:
pass
class KlassHashable:
def __hash__(self):
return 123
bf.add(KlassX()) # this won't work.
bf.add(KlassHashable()) # this will "work" but not in a way we want?
right?
No problem copying the tests from your numba implementation at |
Hey, I just wanted to second the merge on this pull request. I use pybloom with the multiprocessing library and this branch worked like a charm! |
Any updates on getting this merged? |
I've addressed comments above and resolved conflicts in a separate PR here: #56 |
Merged in #56, thanks everyone. |
I've just released this as v0.6.0 on pypi. 🎉 |
Here's my first go at making in-memory bloom filters pickleable.
I also added cases to add() and contains() for bytes. Without this, the bloomfilter doesn't work for byte inputs when saved/reopened in a new Python process.
Please can you take a look and provide feedback?
I should add tests :), have run out of time today.