Re: Classes and threading

2010-05-19 Thread Adam W.
On May 19, 12:04 am, Erik Max Francis m...@alcyone.com wrote: Adam W. wrote: I thought I knew how classes worked, but this code sample is making my second guess myself: import threading class nThread(threading.Thread):     def __init__(self):         threading.Thread.__init__(self)

Re: Classes and threading

2010-05-19 Thread Duncan Booth
Adam W. awasile...@gmail.com wrote: If you don't intend to override the constructor in the parent class, simply don't define it. Hummm, so lets say I wanted it pass all the variables to the parent constructor, how would I do that? I wouldn't have to list every variable it could possible

Re: Classes and threading

2010-05-19 Thread Gregory Ewing
Erik Max Francis wrote: Adam W. wrote: class nThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) If you don't intend to override the constructor in the parent class, simply don't define it. Or if you do need to override it for some reason, you need

Re: Classes and threading

2010-05-19 Thread Adam W.
On May 19, 4:30 am, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: 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,

Re: Classes and threading

2010-05-19 Thread Christian Heimes
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

Re: Classes and threading

2010-05-19 Thread Aahz
In article mailman.399.1274262243.32709.python-l...@python.org, Christian Heimes li...@cheimes.de wrote: class nThread(threading.Thread): def __init__(self, *args, **kwds): threading.Thread.__init__(self, *args, **kwds) # your other stuff here Since

Classes and threading

2010-05-18 Thread Adam W.
I thought I knew how classes worked, but this code sample is making my second guess myself: import threading class nThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self,args): print self.name print self.args pants =

Re: Classes and threading

2010-05-18 Thread Erik Max Francis
Adam W. wrote: I thought I knew how classes worked, but this code sample is making my second guess myself: import threading class nThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self,args): print self.name print self.args