[issue33777] dummy_threading: .is_alive method returns True after execution has completed
Jeffrey Kintscher
report at bugs.python.org
Fri May 3 21:27:55 EDT 2019
Jeffrey Kintscher <websurfer at surf2c.net> added the comment:
This behavior still exists in 3.7.3:
Python 3.7.3 (default, May 1 2019, 00:00:47)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
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
It is inconsistent with the threading module behavior (which matches the 2.x behavior):
Python 3.7.3 (default, May 1 2019, 00:00:47)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from threading import Thread
>>> def f(): print('foo')
...
>>> t = Thread(target=f)
>>> t.start()
foo
>>> t.is_alive()
False
>>> t.join()
>>> t.is_alive()
False
I would classify this as a bug since the documentation claims the dummy_threading module is supposed to be a drop-in replacement for the threading module.
----------
nosy: +websurfer5
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33777>
_______________________________________
More information about the Python-bugs-list
mailing list