On Aug 4, 12:39 pm, william tanksley <[EMAIL PROTECTED]> wrote: > Paddy <[EMAIL PROTECTED]> wrote: > > What's one of them then? > > I'm sorry, I don't know what you mean. > > Meanwhile, more pertinently: I did get my generator working, and then > I replaced it with a class that did the same thing in less than a > quarter of the number of lines. So... I'm not going to worry about > that anymore. My use case obviously wasn't the right one for them. > > 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. > > > - Paddy. > > -Wm
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). -- http://mail.python.org/mailman/listinfo/python-list