subclassing Thread and start

Aahz aahz at pythoncraft.com
Fri Jun 20 15:02:59 EDT 2003


In article <uk86fv060t84jqno0mniak1ol6s3nn415c at 4ax.com>,
Gonçalo Rodrigues  <op73418 at mail.telepac.pt> wrote:
>
>In order to simplify managing Thread's, I want my (derived) Thread's
>to do two things when they start running: return their thread id to
>the thread that started them, and set an attribute, e.g. self.id, to
>the Thread id.

Why not create a synthetic ID that you pass in to the Thread constructor
and set self.id in __init__()?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra




More information about the Python-list mailing list