Class level return/exit in Python
<p>In my application I have a loop that in each turn creates an instance of a class which performs some operations. In this class I have a signal timer that when invoked is supposed to exit the current turn in the loop gracefully and allow the next operation to continue without any interruption.</p>

<p>In it's current state it raises an exception that is supposed to be caught by a try-except-block. However I have a "loadFinished" signal (that I don't know the id for) that is invoked after the exception is thrown and causes a runtime exception on the function definition that I can't catch.</p>

<p>Is there a way to do a class level return like one would do to end a function if something is wrong? Or maybe some kind of sys.exit() that only works on the class?</p>

<p>I hope I made myself clear. :) Thank you for your help.</p>
