Re: Decorator Pattern with Iterator

2012-06-11 Thread Ian Kelly
On Mon, Jun 11, 2012 at 1:51 AM, Tom Harris wrote: > Greetings, > > I have a class that implements the iterator protocol, and tokenises a string > into a series of tokens. As well as the token, it keeps track of some > information such as line number, source file, etc. So each processor needs to

Decorator Pattern with Iterator

2012-06-11 Thread Oscar Benjamin
On 11 June 2012 08:51, Tom Harris wrote: > Greetings, > > I have a class that implements the iterator protocol, and tokenises a > string into a series of tokens. As well as the token, it keeps track of > some information such as line number, source file, etc. > > for tokens in Tokeniser(): > do

Decorator Pattern with Iterator

2012-06-11 Thread Tom Harris
Greetings, I have a class that implements the iterator protocol, and tokenises a string into a series of tokens. As well as the token, it keeps track of some information such as line number, source file, etc. for tokens in Tokeniser(): do_stuff(token) What I want is to be able to wrap the toke