A Python generator yielding a list in chunks. Cf. http://stackoverflow.com/a/312464