Classes and threading

Aahz aahz at pythoncraft.com
Wed May 19 19:41:10 EDT 2010


In article <mailman.399.1274262243.32709.python-list at python.org>,
Christian Heimes  <lists at cheimes.de> wrote:
>>
>>     class nThread(threading.Thread):
>>         def __init__(self, *args, **kwds):
>>             threading.Thread.__init__(self, *args, **kwds)
>>             # your other stuff here
>
>Since Thread is a new style class, this should read:
>
>class NThread(threading.thread):
>     def __init__(self, *args, **kwargs):
>         super(NThread, self).__init__(*args, **kwargs)

"Should" is too strong.  There are plenty of reasons for wanting to avoid
the mess of super().
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

f u cn rd ths, u cn gt a gd jb n nx prgrmmng.



More information about the Python-list mailing list