`while not exhausted` is a bit more Pythonic