I have a problem extending Thread class in Python. This is my simple code:
import threading
class position:
def __init__(self,id):
self.id = id
class foo(threading.Thread):
def __init__(self):
self.start = position(0)
threading.Thread.__init__(self)
def run(self):
pass
if __name__ == '__main__':
f = foo()
f.start()
The shown error is:
Traceback (most recent call last):
File "foo.py", line 19, in <module>
f.start()
AttributeError: position instance has no __call__ method
Where is the error? i have spended 3 hours searching for a solution, but i can't find one. I have extended Thread class many time during my work, but this time it won't work.