Wouldn't it be better if you return the generator instead of the list?