Python · Filtered Search

Filtered Search

3.0.0-rc.1 · 4c3e5023

A predicate admits keys one at a time. Non-matching entries still route the traversal, so recall does not collapse at low selectivity. The callback re-enters Python from the library’s threads, so it runs under the GIL and serializes the walk, while every other verb releases the GIL and lets the library parallelize internally.

index.on(pool).search(queries, 10, arena, predicate=lambda key: int(key) % 2 == 0)

A progress handler is called with (completed, total) units; False stops the call, and None, what a bare print answers, carries on. insert is the exception: every entry is claimed before the first report, so its handler reports and cannot stop the batch. The first exception any callback raises outranks the outcome it turned into, whether the call blocked or was deferred.