At 08:43 PM 3/26/2009 +1200, Greg Ewing wrote:
Trying to think of a better usage example that
combines send() with returning values, I've realized
that part of the problem is that I don't actually
know of any realistic uses for send() in the first
place.
Can anyone point me to any? Maybe it will help
to inspire a better example.
Er, well, I don't know what anybody *else* wanted them for, but I
wanted them to implement improved trampoline functions, vs. earlier
Python versions. ;-)
The trampoline example I gave uses send() in order to pass the return
values from one generator back into another. Of course, the task
object also has a send(), so if you do find another use case for
send() in a co-operative context, it should be equally doable with
the trampoline.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com