Using Generators as Tasks

I read a bit of python doc, and finally understood how arguments were passed whatever nature.
So I changed a few things, you can now add extraArgs to your task, appendTask or whatever you wish!


class GeneratorTask:
    def __init__(self,func):#where func returns a generator
        self.generator=func
        self.__isfirstcall__=True
    def __call__(self,*args,**kwargs):
        #check is it's the first call
        if self.__isfirstcall__:
            self.generator=self.generator(*args,**kwargs)
            self.__isfirstcall__ = False
        #do the thingy
        try:
            yielded=self.generator.next()
        except StopIteration:
            return Task.done
        #the generator ought to yield Task attributes
        #if None is yielded the Panda Reference specifies
        #it will end the task
        return yielded