And the above might be neater as:
```python
batch = list(islice(iterable, size))
while batch:
    yield batch
    batch = list(islice(iterable, size))
```