New submission from Nate Atkinson <n...@nearlyrespectable.com>:

Here's what I expect to happen (Python2 behavior):


Python 2.7.14+ (default, Dec  5 2017, 15:17:02)
[GCC 7.2.0] on linux2
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()
False
>>>




Here's what actually happens (Python3.6):


Python 3.6.4 (default, Jan  5 2018, 02:13:53)
[GCC 7.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
>>>



After completion of the target function, I would expect .is_alive() to return 
False for an instance of dummy_thread.Thread. Instead, it returns True until 
the .join() method of the instance of dummy_thread.Thread is called.

----------
components: Interpreter Core
messages: 318795
nosy: njatkinson
priority: normal
severity: normal
status: open
title: dummy_threading: .is_alive method returns True after execution has 
completed
type: behavior
versions: Python 3.6

_______________________________________
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