At 01:04 AM 12/15/2007 -0800, tomer filiba wrote: >* do you suppose it will work? are there any drawbacks i didn't >anticipate? Yes. :) Specifically, think about what happens when a C function is in the call stack, e.g.: def f1(): return map(f2, [1,2,3]) def f2(ob): raise WaitFor(something) return ob print f1() If I understand you correctly, when this program is run, it will print "1", rather than "[1, 2, 3]", because there is no way for you to keep track of the internal state of the 'map()' call. And this isn't just a problem for map() -- even something as simple as a property access passes through C code whose state can get lost. I don't think this approach is practical; you'd be better off using a co-routine stack and trampoline, since the nature of generators naturally forces all the C code out of the picture.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4