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

Anthony Green report at bugs.python.org
Mon Dec 7 19:09:37 EST 2015


Anthony Green added the comment:

The following example comes from IRC user ztane:

> import threading, time
>
> main_thread = threading.current_thread()
> 
> def foo():
>     time.sleep(10)
>     print(main_thread.is_alive())
>     print(list(threading.enumerate()))
> 
> t = threading.Thread(target=foo)
> t.start()

False
[<_MainThread(MainThread, stopped 140040101766976)>, <Thread(Thread-1, started 140040068695808)>]

----------

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


More information about the docs mailing list