how to make a generator use the last yielded value when it regains control

John Salerno johnjsal at NOSPAMgmail.com
Sat Apr 8 19:06:32 EDT 2006


Michael Spencer wrote:

> itertools.groupby makes this very straightforward:

I was considering this function, but then it seemed like it was only 
used for determing consecutive numbers like 1, 2, 3 -- not consecutive 
equivalent numbers like 1, 1, 1. But is that not right?



More information about the Python-list mailing list