Hi.
I encountered an error in using a generator method 'send()'. Is this method
not supported in pyjs? I printed the type and value of the generator, and
the result showed that its value was a correct generator. But, an error
(not supporting the method send()) was thrown:
----[this is the source]----
class AsyncEngine(object):
def loop_forAsyncRecur(self, g, g_next):
while True:
try:
print 'in loop_forAsyncRecur(), type(g)=%s, g=%s' %
(type(g), g)
g_next=g.send(g_next)
...
----[this is the output]----
in loop_forAsyncRecur(), type(g)=class ContextAsyncRun, g=class
generator
Unknown exception: [object Error]
Traceback:
....
asyncEngine.py, line 60:
g_next=g.send(g_next)
SCRIPT438: The Object doesn't support property of method 'send'
This code runs well in pyjd (desktop version), but not in pyjs (webbroser
version). Javascript supports generator features same to Python including
the method send(), and I guess that the Python generator can be executed in
Javascript directly after python-to-javascript translation. So, I am
wondering why I see this error.
--
---
You received this message because you are subscribed to the Google Groups
"Pyjs.org Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.