On Mon, Aug 17, 2015 at 3:25 PM, <alex.fl...@gmail.com> wrote: > > Sorry I completely mistype that. It was supposed to read: > > >>> id(multiprocessing.Process.is_alive) == > id(multiprocessing.Process.start) > True >
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. > >>> multiprocessing.Process.is_alive is multiprocessing.Process.start > False > In this case, the "is" operator keeps both references around during its call, and therefore they will get different ids. 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. > > -- > https://mail.python.org/mailman/listinfo/python-list >
-- https://mail.python.org/mailman/listinfo/python-list