Reputation: 4801
I'm subclassing the threading.Thread
class and it currently looks like this:
class MyThread(threading.Thread):
def __init__(self:
super(MyThread, self).__init__()
def run(self):
# Do some stuff
Is the __init__
required in this instance? If I leave it out, is it called automatically?
Upvotes: 6
Views: 399
Reputation:
No, it is not needed in this case.
When instantiating a class, if it has no __init__
method, the __init__
method of the super class is automatically called.
Upvotes: 8