[Stackless] Newbie question

Jay Shaffstall jshaffstall at gmail.com
Thu Sep 25 03:39:19 CEST 2008


Another question that probably has an easy answer I'm just not seeing.
 For my simulation, I would like to subclass tasklet.  In the
Stackless docs, it shows doing this so that extra data gets pickled
properly.   I'm using code of this form (this is a bare bones sample
to show the problem):

class Test(stackless.tasklet):
    def __init__(self,a1,a2,a3):
        stackless.tasklet.__init__(self,self.message_loop)

    def message_loop(self):
        print "Hello"

The error I get when I try to instantiate Test is this:

    TypeError: tasklet() takes at most 1 argument (3 given)

The above structure works fine if I inherit from something else, but
not from tasklet.  Am I missing a trick to overriding tasklet's init?
I'm using the Python 2.5 version of Stackless.

Thanks,
Jay




More information about the Stackless mailing list