Re: Would like some thoughts on a grouped iterator.

2016-09-05 Thread Jussi Piitulainen
Peter Otten writes: > Jussi Piitulainen wrote: [- -] >> while more: >> yield gp() [- -] > As usual I couldn't stop and came up with something very similar: [- -] > while more: > g = group() > yield g > for _ in g: pass [- -] > The one thing I think y

Re: Would like some thoughts on a grouped iterator.

2016-09-05 Thread Peter Otten
Jussi Piitulainen wrote: > Antoon Pardon writes: > >> I need an interator that takes an already existing iterator and >> divides it into subiterators of items belonging together. >> >> For instance take the following class, wich would check whether >> the argument is greater or equal to the previ

Re: Would like some thoughts on a grouped iterator.

2016-09-05 Thread Jussi Piitulainen
Antoon Pardon writes: > I need an interator that takes an already existing iterator and > divides it into subiterators of items belonging together. > > For instance take the following class, wich would check whether > the argument is greater or equal to the previous argument. > > class upchecker:

Re: Would like some thoughts on a grouped iterator.

2016-09-05 Thread Steven D'Aprano
On Monday 05 September 2016 18:46, Antoon Pardon wrote: > I need an interator that takes an already existing iterator and > divides it into subiterators of items belonging together. > > For instance take the following class, wich would check whether > the argument is greater or equal to the previ

Re: Would like some thoughts on a grouped iterator.

2016-09-05 Thread breamoreboy
On Monday, September 5, 2016 at 10:42:27 AM UTC+1, Peter Otten wrote: > Antoon Pardon wrote: > > > I need an interator that takes an already existing iterator and > > divides it into subiterators of items belonging together. > > > > For instance take the following class, wich would check whether

Re: Would like some thoughts on a grouped iterator.

2016-09-05 Thread Peter Otten
Antoon Pardon wrote: > I need an interator that takes an already existing iterator and > divides it into subiterators of items belonging together. > > For instance take the following class, wich would check whether > the argument is greater or equal to the previous argument. > > class upchecker: