switch type annotation to Iterable for a generator