Jeff <[EMAIL PROTECTED]> wrote: > william tanksley <[EMAIL PROTECTED]> wrote: > > I'm still curious, though, whether anyone's written any code that > > actually uses yield _and_ send() to do anything that isn't in the > > original PEP.
> I have. An iterator that could backtrack itself without the user > having to remember previous states. It would just send back something > like reader.send('prev_token') or reader.send(-1). Ah, nice! I now remember briefly thinking that such a thing should be possible. Interestingly, I just recently wrote a backtracking search, so I could have used such a thing -- it's a pity that I didn't remember about send() while I was doing that. I may have to alter my design to see what happens. -Wm -- http://mail.python.org/mailman/listinfo/python-list