This article proposes an implementation of an ergonomic binary search algorithm implemented as a bidirectional generator.
Learn how batched from the module itertools works, example use cases, and how to implement it.
Today I learned that generators support membership testing with the operator in.