Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92848 > unrolled thread
| Started by | ravi <temp.sha@gmail.com> |
|---|---|
| First post | 2015-06-18 12:47 -0700 |
| Last post | 2015-06-18 14:00 -0700 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.python
python program without stackless.run() ravi <temp.sha@gmail.com> - 2015-06-18 12:47 -0700
Re: python program without stackless.run() Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-18 14:10 -0600
Re: python program without stackless.run() ravi <temp.sha@gmail.com> - 2015-06-18 14:00 -0700
| From | ravi <temp.sha@gmail.com> |
|---|---|
| Date | 2015-06-18 12:47 -0700 |
| Subject | python program without stackless.run() |
| Message-ID | <fc770e8e-a269-4325-b211-efe09327c3ea@googlegroups.com> |
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
[toc] | [next] | [standalone]
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2015-06-18 14:10 -0600 |
| Message-ID | <mailman.612.1434658252.13271.python-list@python.org> |
| In reply to | #92848 |
On Thu, Jun 18, 2015 at 1:47 PM, ravi <temp.sha@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
[toc] | [prev] | [next] | [standalone]
| From | ravi <temp.sha@gmail.com> |
|---|---|
| Date | 2015-06-18 14:00 -0700 |
| Message-ID | <2ab67226-2890-4fef-ae90-21b035f5420d@googlegroups.com> |
| In reply to | #92850 |
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.sha@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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web