On Sun, Mar 14, 2010 at 9:52 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sat, 13 Mar 2010 21:16:22 -0600, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> Perhaps the status should be set to 0 and the error to '' in the<br>
> situation where I put in the wrong values (thinking it was failure).<br>
<br>
</div>I tried that, but it broke something else. It seems that the convention<br>
is to set these globals before calling, and then check whether they have<br>
changed. This looks very yucky to me, perhaps Matt can explain why it<br>
is this way.</blockquote><div><br></div><div>Okay, whatever 'yuckiness' is here is imposed on us by the threading package.</div><div>I think what is confusing you guys is the reprocessing of output, since Satish</div>
<div>likes it cleaned up. The 'else' branch where Barry added code is actually the</div><div>success branch since thread.isAlive() is false, meaning it completed. We reprocess</div><div>the output and return. The status and error have already been set during the</div>
<div>run() call. Its this call that makes us us globals for these variables. Its the Python</div><div>equiv of a closure.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
Jed</font></blockquote></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>