In article ,
Christian Heimes 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 NThre
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
On May 19, 4:30 am, Gregory Ewing 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, *args, **kwds)
>
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 to
"Adam W." 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 receive woul
On May 19, 12:04 am, Erik Max Francis 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)
>
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
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 = nThread(a