阅读背景:

如何在CPython中实现生成器和协同程序?

来源:互联网 

I've read that in CPython, the interpreter stack (the list of Python functions called to reach this point) is mixed with the C stack (the list of C functions that were called in the interpreter's own code). If so, then how are generators and coroutines implemented? How do they remember their execution state? Does CPython copy each generator's / coroutine's stack to and from an OS stack? Or does CPython simply keep the generator's topmost stack frame on the heap, since the generator can only yield from that topmost frame?I've read that in CPython, the interpreter stac




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: