Edit: This is a silly mistake, look at the answers, but my init method does not define a self variable.
I have several python classes that are stages in a pipeline. They inherit from a base class.
class StageBase(object):
key = Segments.NONE
_preprocessors = []
def __init__():
self.closing = False
self.working = False
self._que = None
self._working_lock = None
self._que_lock = None
#whole bunch of other methods
The inheriting classes override key and _preprocessors. Before adding the explicit __init__() method, everything worked fine, now I get the following error:
TypeError: __init__() takes no arguments (1 given)
The line of the error is the line where I override _preprocessors (in this example, this class variable represents other stages that should be executed before this stage).
An example class that throws this error:
class StaticPageStage(StageBase):
key = Segments.STATICPAGE
_preprocessors = [FacebookGraphStage(), ]
def __init__():
pass
def process(self, data):
data = self._preprocess(data)
return self.handle_results(tuple(x for x in data))
Can anyone tell me how to fix this?