<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 14px; ">Hi,<div>
<br></div><div><span style="font-family: arial, sans-serif; font-size: 14px; border-collapse: collapse; "><div>Is there anyway to specify that I want a block or function to work in different stack frame in python ?</div><div>
I'm thinking about something like this:</div><div><br></div><div>def check_something(magic_stack_frame, blah):</div><div> if blah > 10</div><div> return "Error...."</div><div> else:</div><div> # do something</div>
<div> return</div><div><br></div><div><br></div><div>def myf():</div><div> blah = 20</div><div> check_something(current_stack_frame, blah)</div><div> print('should not be here')</div><div><br></div><div>In this case, I don't want to see the message 'should not be here'. The return "Error ...." should be done as if check_something</div>
<div>is in the same stack frame of myf() instead of check_something</div><div><br></div><div>Thanks,</div></span></div></span></span></font><br>-- <br>-Nick Kanakakorn<br>