need help on generator...

Craig Ringer craig at postnewspapers.com.au
Fri Jan 21 16:06:54 CET 2005


On Fri, 2005-01-21 at 22:38 +0800, Craig Ringer wrote:

> consecutive_sets = ( x[offset:offset+subset_size]
>                      for subset_size in xrange(2, len(x))
>                      for offset in xrange(0, len(x) + 1 - subset_size) )

Where 'x' is list to operate on, as I should've initially noted. Sorry
for the reply-to-self.

I did say "awful" for a reason ;-)

--
Craig Ringer




More information about the Python-list mailing list