I had doubts about the existing flow in pybloomfilter.pyx, so hopefully these changes will clear things up a little:
By creating a BloomFilter instance, we expect a new file to be created by default (or done in-memory). No mode argument should be supplied.
By calling BloomFilter.open(), we expect a file to already be present for reading, thus allowing to specify the file read mode (either "r" (read-only) or "rw").
By calling BloomFilter.from_base64() / BloomFilter.copy() / BloomFilter.copy_template(), we create a file implicitly and open it in "rw" mode.
With 9a360ce I've changed references to the old bf.name.decode() to bf.filename as of #25. Rest of the commits were a result of a rebase. Merging this for 0.5.1.
Regression: removed "mode" parameter from
BloomFilter.from_base64()
introduced in 0.5.0 (https://github.com/prashnts/pybloomfiltermmap3/pull/13)I had doubts about the existing flow in
pybloomfilter.pyx
, so hopefully these changes will clear things up a little:BloomFilter
instance, we expect a new file to be created by default (or done in-memory). Nomode
argument should be supplied.BloomFilter.open()
, we expect a file to already be present for reading, thus allowing to specify the file readmode
(either "r" (read-only) or "rw").BloomFilter.from_base64()
/BloomFilter.copy()
/BloomFilter.copy_template()
, we create a file implicitly and open it in "rw" mode.