[docs] [issue25821] Documentation for threading.enumerate / threading.Thread.is_alive is contradictory.

Anthony Green report at bugs.python.org
Mon Dec 7 19:03:40 EST 2015


New submission from Anthony Green:

The documentation at https://docs.python.org/3/library/threading.html#threading.Thread.is_alive relates:

> The module function enumerate() returns a list of all alive threads.

The documentation at https://docs.python.org/3/library/threading.html#threading.enumerate relates:

> Return a list of all Thread objects currently alive. The list includes daemonic threads, dummy thread objects created by current_thread(), and the main thread.

This is a contradiction, since if the main thread has stopped, is_alive(main_thread) will return False, but it will still be included in the list returned by threading.enumerate.

Note that this is not a TOCTTOU issue. The issue is that enumerate actually includes "all alive threads, plus one [or more? I can't tell from the code] other[s]."

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25821>
_______________________________________


More information about the docs mailing list