diff --git a/pottery/bloom.py b/pottery/bloom.py index c2aae7ce..46276dfc 100644 --- a/pottery/bloom.py +++ b/pottery/bloom.py @@ -362,13 +362,7 @@ def contains_many(self, *values: JSONTypes) -> Generator[bool, None, None]: # I stole this recipe from here: # https://stackoverflow.com/a/61435714 - # - # TODO: When we drop support for Python 3.7, rewrite the following loop - # using the walrus operator, like in the Stack Overflow answer linked - # above. - bits_per_chunk = self.num_hashes() - while True: - bits_in_chunk = tuple(itertools.islice(bits, bits_per_chunk)) + while bits_in_chunk := tuple(itertools.islice(bits, self.num_hashes())): if not bits_in_chunk: break yield all(bits_in_chunk)