python program without stackless.run()

2015-06-18 Thread ravi

Hi,

I could not understand how the below program executes function fun without 
calling stackless.run() in the program?  Here fun runs as a tasklet and as 
per my knowledge for that stackless.run() is must.



-
import stackless

class A:
def __init__(self,name):
self.name = name
self.ch = stackless.channel()
stackless.tasklet(self.fun)()

def __call__(self,val):
self.ch.send(val)

def fun(self):
   while 1:
 v = self.ch.receive()
 print hi , v


if __name__ == __main__:
obj = A(sh)
obj(6)
-

output:
--
hi 6





thanks,
ravi
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python program without stackless.run()

2015-06-18 Thread ravi
On Friday, June 19, 2015 at 1:41:36 AM UTC+5:30, Ian wrote:
 On Thu, Jun 18, 2015 at 1:47 PM, ravi temp@gmail.com wrote:
  I could not understand how the below program executes function fun 
  without calling stackless.run() in the program?  Here fun runs as a 
  tasklet and as per my knowledge for that stackless.run() is must.
 
 You seem to have a lot of questions about stackless. You might find
 that you get a better, more focused response if you ask your questions
 on the stackless mailing list:
 http://www.stackless.com/mailman/listinfo/stackless

thanks for your pointer. I will post my queries to stackless mailing list.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python program without stackless.run()

2015-06-18 Thread Ian Kelly
On Thu, Jun 18, 2015 at 1:47 PM, ravi temp@gmail.com wrote:
 I could not understand how the below program executes function fun without 
 calling stackless.run() in the program?  Here fun runs as a tasklet and as 
 per my knowledge for that stackless.run() is must.

You seem to have a lot of questions about stackless. You might find
that you get a better, more focused response if you ask your questions
on the stackless mailing list:
http://www.stackless.com/mailman/listinfo/stackless
-- 
https://mail.python.org/mailman/listinfo/python-list