New submission from Greg Solomon:
https://docs.python.org/3/library/itertools.html#itertools.groupby
I found the "equivalent" code a bit hard to read. Is there any merit in
changing it to something a bit like the following ?
Kind Rgds, Greg
class groupby:
def __init__( self
Greg Solomon added the comment:
Oh, I get it. There needs to be a next(self.it) loop in __next__ as well as in
_grouper in case the user doesn't call _grouper.
My test was
for ( k , g ) in groupby( L ):
print ( k , len( list( g ) ) )
so I was executing _grouper on every row.
T