10 Apr
2009
10 Apr
'09
8:08 p.m.
Nick Coghlan wrote:
Note that my example actually *does* modify the class as it goes along (for exactly the reason you give - next() has to be defined on the class or the interpreter will ignore it).
Sorry, I didn't notice you were doing that. But this doesn't seem useful to me. What if you have two instances of Tricky in use at the same time? They're going to interfere with each other. I suppose you could make it work if you created a new class each time. But my earlier comment stands -- I don't want to preclude optimizing the common case for the sake of an uncommon case. -- Greg