Hi,
Small question. Every object I know of in python can take care of its base class initialization by calling
super(BaseClass, self).__init__()
This doesn't seem to be the case with a subclass of threading.Thread
, since if I try this in SubClass.__init__()
, I get:
RuntimeError: thread.__init__() not called
What gives? I looked at the source for threading.Thread and it looks like that __init__
method should set Thread.__initialized = True
. I see that all examples use the following __init__
:
class YourThread(threading.Thread):
def __init__(self, *args):
threading.Thread.__init__(self)
# whatev else
But why?