Is it possible to programmatically construct a Python stack frame and start execution at an arbitrary point in the code?
问题 Is it possible to programmatically construct a stack (one or more stack frames) in CPython and start execution at an arbitrary code point? Imagine the following scenario: You have a workflow engine where workflows can be scripted in Python with some constructs (e.g. branching, waiting/joining) that are calls to the workflow engine. A blocking call, such as a wait or join sets up a listener condition in an event-dispatching engine with a persistent backing store of some sort. You have a