It will return 1, 3 instead of (1, 1) in the second assert. I'm not sure what you core is trying to do, but it seems that it doesn't try storing groups in any way.
I will probably fix this myself, but if you would do this first I suggest you to look at how I've implemented fully lazy (in a sence that it wouldn't get next item, until it really have to) groupby iterable here
It will return 1, 3 instead of (1, 1) in the second assert. I'm not sure what you core is trying to do, but it seems that it doesn't try storing groups in any way.
I will probably fix this myself, but if you would do this first I suggest you to look at how I've implemented fully lazy (in a sence that it wouldn't get next item, until it really have to) groupby iterable here