This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: threading docs, start error should be specified
Type: enhancement Stage: test needed
Components: Documentation Versions:
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, alanvgreen, reowen
Priority: normal Keywords:

Created on 2004-02-25 20:00 by reowen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg60467 - (view) Author: Russell Owen (reowen) Date: 2004-02-25 20:00
The docs say it is an error to start a threading thread more than once, but they do not specify exactly what exception will be raised.

Apparently it is always AssertionError (though an expert should verify this).

It would be very helpful to document the exception because there is no other documented way to tell if a threading thread has been started than to try to start it.

I posted to the dev group on 2003-02-24 about this and Aahz asked me to file a doc bug. So here it is.

I suggest the info go in the Thread object docs, in the documentation for "start".
msg60468 - (view) Author: Alan Green (alanvgreen) Date: 2005-01-22 10:30
Logged In: YES 

The actual wording in the documentation is: "This must be
called at most once per thread object." To me this implies
that the effect of calling start() twice is not defined. 

There is an assert statement in the implementation of
Thread.start(), but - like all assert statements - its
behaviour is dependent upon the value of the builtin
__debug__ variable.

Looking through the rest of the threading module, the
documentation could be tightened up, particularly with
respect to which behaviours are and aren't defined.
msg60469 - (view) Author: Russell Owen (reowen) Date: 2005-01-24 19:47
Logged In: YES 

There is still the problem that the threading module presents no reasonable 
way to tell if a thread is safe to start (i.e. whether or not it has already been 

A standard documented exception is one way to handle this (AssertionError 
is clearly not the best choice). A method or attribute would be even better, 
but would require a change in interface.

Right now one has to keep a separate state flag, which is risky.
msg114329 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-19 06:29
The docs for start() state "This method will raise a RuntimeException if called more than once on the same thread object."
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 39982
2010-08-19 06:29:34BreamoreBoysetstatus: open -> closed

nosy: + BreamoreBoy
messages: + msg114329

resolution: out of date
2009-02-13 04:14:09ajaksu2settype: enhancement
stage: test needed
2004-02-25 20:00:43reowencreate