Why doesn't threading.join() return a value?

Chris Torek nospam at torek.net
Sat Sep 3 03:04:16 CEST 2011

In article <roy-030914.19162802092011 at news.panix.com>
Roy Smith  <roy at panix.com> wrote:
>Thread.join() currently returns None, so there's 
>no chance for [return value] confusion.

Well, still some actually.  If you use my example code (posted
elsethread), you need to know:

  - that there was a target function (my default return
    value if there is none is None); and
  - that the joined thread really did finish (if you pass
    a timeout value, rather than None, and the join times
    out, the return value is again None).

Of course, if your target function always exists and never returns
None, *then* there's no chance for confusion. :-)
In-Real-Life: Chris Torek, Wind River Systems
Intel require I note that my opinions are not those of WRS or Intel
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W)  +1 801 277 2603
email: gmail (figure it out)      http://web.torek.net/torek/index.html

More information about the Python-list mailing list