[Stackless] 1. Stackless Error (Carl, Andrew F (AS))

Carl, Andrew F (AS) a.carl at ngc.com
Mon Mar 15 19:14:57 CET 2010

Andrew / Christian,

Yes, stackless.run had been called, just not included in the email.
"self" is just the current class instance, really does not matter. It
appears that the important point is the definition of what can
constitute a "callable". (i.e. function, class instance...?).


-----Original Message-----
From: Christian Tismer [mailto:tismer at stackless.com] 
Sent: Saturday, March 13, 2010 6:07 AM
To: The Stackless Python Mailing List
Cc: Andrew Francis; Carl, Andrew F (AS)
Subject: Re: [Stackless] 1. Stackless Error (Carl, Andrew F (AS))

On 3/13/10 2:34 PM, Andrew Francis wrote:
> Hi Andy:
> --- On Sat, 3/13/10,
stackless-request at stackless.com<stackless-request at stackless.com>  wrote:
>> Message: 1
>> Date: Fri, 12 Mar 2010 11:50:52 -0600
>> From: "Carl, Andrew F (AS)"<a.carl at ngc.com>
>> To:<stackless at stackless.com>
>> Cc: "Carl, Andrew F \(AS\)"<a.carl at ngc.com>
>> Subject: [Stackless] Stackless Error
>> Message-ID:
<CE1C9C26CC18FD4E804F232CEC1F845103B10BBF at XMBTX132.northgrum.com>
>> Content-Type: text/plain; charset="us-ascii"
>> Attempting to use the following:
>> Stackless.tasklet( self.r_run(args) )
>> I get the following post run error:
>> "TypeError: tasklet function must be a callable"
> I don't know what self is. However tasklet() expects a callable (
> hence the error). A while you can create a tasklet is by passing
> function (a callable) to the tasklet function. The arguments are
passed separately.
> example
> def printIt(message):
>      print message
> stackless.tasklet(printIt)(message)
The confusing part of this is that Andy did not call stackless.run,
so his test appears to do nothing, because the tasklet does not run at
all in the first place and gets killed when python ends.

The other approach
   Stackless.tasklet( self.r_run(args) )
breaks for the reason you pointed out.

cheers - chris

Christian Tismer             :^)<mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key ->  http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/

More information about the Stackless mailing list