Prev: Pointers on packaging python programs for installation on multipleplatforms?
Next: question on logging module
From: Christian Heimes on 19 May 2010 05:43 > Or if you do need to override it for some reason, you > need to accept the extra args and pass them on: > > 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) Christian
From: Aahz on 19 May 2010 19:41 In article <mailman.399.1274262243.32709.python-list(a)python.org>, Christian Heimes <lists(a)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(a)pythoncraft.com) <*> http://www.pythoncraft.com/ f u cn rd ths, u cn gt a gd jb n nx prgrmmng.
First
|
Prev
|
Pages: 1 2 Prev: Pointers on packaging python programs for installation on multipleplatforms? Next: question on logging module |