<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 17, 2015 at 3:25 PM, <span dir="ltr"><<a href="mailto:alex.flint@gmail.com" target="_blank">alex.flint@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry I completely mistype that. It was supposed to read:<br>
<br>
>>> id(multiprocessing.Process.is_alive) == id(multiprocessing.Process.start)<br>
True<br></blockquote><div><br></div><div>What is going on here is that it get multiprocessing.Process.is_alive, computes the id of it, then throws away the value of multiprocessing.Process.is_alive. It then does the same thing for multiprocessing.Process.start, where by it happens to reuse the id of the first value.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>>> multiprocessing.Process.is_alive is multiprocessing.Process.start<br>
False<br></blockquote><div><br></div><div>In this case, the "is" operator keeps both references around during its call, and therefore they will get different ids.</div><div><br></div><div><br></div><div>The rules for the id is that they are only guaranteed unique during the lifespan of both objects. Also, generally, you do not want to use id or is for much of anything unless you really know what you are doing - generally, you just want == instead.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><font color="#888888"><br>
--<br>
<a href="https://mail.python.org/mailman/listinfo/python-list" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div></div>