Skip to content
Snippets Groups Projects
Commit 91f2d78d authored by Radek Hušek's avatar Radek Hušek Committed by Radek Hušek
Browse files

small fix in chunkme()

parent e7350527
No related branches found
No related tags found
No related merge requests found
...@@ -8,10 +8,10 @@ from itertools import chain ...@@ -8,10 +8,10 @@ from itertools import chain
def chunkme(X, chunksize): def chunkme(X, chunksize):
chunk = [] chunk = []
for x in X: for x in X:
chunk.append(x)
if len(chunk) >= chunksize: if len(chunk) >= chunksize:
yield chunk yield chunk
chunk = [] chunk = []
chunk.append(x)
if len(chunk): if len(chunk):
yield chunk yield chunk
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment