Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #95456
| From | random832@fastmail.us |
|---|---|
| Subject | Re: why does id(multiprocessing.Process.start) == id(multiprocessing.Process.start)? |
| Date | 2015-08-18 00:11 -0400 |
| References | <dbbdd7bd-63e7-42cb-96d5-523606380bed@googlegroups.com> <f45a1172-03e2-4bb2-8045-8252843d9cdf@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.71.1439871122.4764.python-list@python.org> (permalink) |
On Mon, Aug 17, 2015, at 18:25, alex.flint@gmail.com wrote: > Sorry I completely mistype that. It was supposed to read: > > >>> id(multiprocessing.Process.is_alive) == id(multiprocessing.Process.start) > True > > >>> multiprocessing.Process.is_alive is multiprocessing.Process.start > False Try this: is_alive = multiprocessing.Process.is_alive start = multiprocessing.Process.start id(is_alive) == id(start) If (as I believe it will) this ends up being false, this shows that it's an issue of object lifespan with the values of the expression being temporary method wrappers. From some testing, on my machine on CPython 2.7 this appears to work for any method of any class written in python. While you fixed the typo, it is instructive to note that, as in your original example, multiprocessing.Process.start is multiprocessing.Process.start is *also* False, which would not be the case if the method wrapper were a permanent object.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
why does id(multiprocessing.Process.start) == id(multiprocessing.Process.start)? alex.flint@gmail.com - 2015-08-17 15:23 -0700
Re: why does id(multiprocessing.Process.start) == id(multiprocessing.Process.start)? alex.flint@gmail.com - 2015-08-17 15:25 -0700
Re: why does id(multiprocessing.Process.start) == id(multiprocessing.Process.start)? Ian Kelly <ian.g.kelly@gmail.com> - 2015-08-17 17:11 -0600
Re: why does id(multiprocessing.Process.start) == id(multiprocessing.Process.start)? random832@fastmail.us - 2015-08-18 00:11 -0400
csiph-web