Hmm, but it's precisely the same with python generators. If you yield,
then anything can happen by the time the function returns (same as with
a addCallback - anything can happen between adding the callback and the
time it's called). If you don't yield, but simply call a function, then
only those function's side effects can occur. <br>
<br>
That's because a function called by a generator cannot yield on behalf
of that generator. I didn't appreciate that as a good thing until now,
but now I do.<br>
<br><div><span class="gmail_quote">On 29/05/06, <b class="gmail_sendername"><a href="mailto:zooko@zooko.com">zooko@zooko.com</a></b> &lt;<a href="mailto:zooko@zooko.com">zooko@zooko.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Mark Miller (whose recently completed dissertation is available [1]), recently<br>summarized in one sentence why event-based concurrency is safer than<br>cooperative multithreading.&nbsp;&nbsp;He said (quoting from memory): &quot;The difference is
<br>that in an event-based system, when you invoke a function and the function<br>returns, then you know that the only side-effects that could have happened are<br>side-effects that *that* function was authorized to cause.&quot;
<br><br>Regards,<br><br>Zooko<br><br>[1] <a href="http://erights.org/talks/thesis/index.html">http://erights.org/talks/thesis/index.html</a><br><br>_______________________________________________<br>Twisted-Python mailing list
<br><a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
</a><br></blockquote></div><br>