Nate Atkinson <n...@nearlyrespectable.com> added the comment:

To be clear-- is_alive() doesn't *always* return True. It returns True until 
.join() is called.


Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dummy_threading import Thread
>>> def f(): print('foo')
...
>>> t = Thread(target=f)
>>> t.start()
foo
>>> t.is_alive()
True
>>> t.join()
>>> t.is_alive()
False



I would expect is_alive to return True while the target function is executing 
and return False after the execution has completed. Instead, .is_alive is 
continuing to return True after execution of the target function has completed.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33777>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to