Skip to content
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

Clean up BloomFilter.contains_many() #709

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions pottery/bloom.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,10 @@ def contains_many(self, *values: JSONTypes) -> Generator[bool, None, None]:

Please note that this method *may* produce false positives, but *never*
produces false negatives. This means that if .contains_many() yields
True, then you *may* have inserted the element into the Bloom filter.
But if .contains_many() yields False, then you *must not* have inserted
it.
all Trues, then you *may* have inserted the elements into the Bloom
filter. But if .contains_many() yields one False, then you *must not*
have inserted the corresponding element.
'''
if len(values) > 1:
warnings.warn(
cast(str, InefficientAccessWarning.__doc__),
InefficientAccessWarning,
)

with self._watch() as pipeline:
pipeline.multi() # Available since Redis 1.2.0
for bit_offset in self._bit_offsets_many(*values):
Expand Down
Loading