Feature Request: Reposition Execution
Skybuck Flying
skybuck2000 at hotmail.com
Mon May 11 07:46:04 EDT 2015
Hello,
Sometimes it can be handy to "interrupt/reset/reposition" a running script.
For example something externally goes badly wrong.
The script is unaware of this.
Current solution would require to have an "Abort" boolean everywhere.
The abort boolean could then be set to True to indicate all code and all
loops must abort.
This is far from the ideal solution.
I think a much better solution could be to "reposition" the "instruction
pointer" so to speak.
However for x86 stack clean up would be necessary. I would assume python has
a stack too... which would need cleaning up.
Perhaps the entire stack can simply be cleaned up.
So that the point for execution continuation is always "clean".... in a
"clean state".
So this allows for the stack to be cleaned completely... without any
trouble.
I also hope this feature gets implemented quickly cause I kinda need it.
Therefore I will give some example code to see how it could look like:
def MyFunction():
while SomeCondition:
RunMyCode
return
def OtherFunction():
while BatmanIsAliveLOL:
BustPenguins
return
def DetectProblem:
if ProblemDetected:
Aborted = True
Abort( AbortToPoint )
return
SpawnThread( DetectProblem)
while MyMainLoop:
AbortToPoint:
if Aborted:
Reset stuff
MainCode, Call Routines.
Bye,
Skybuck.
More information about the Python-list
mailing list