IPython Notebook - early exit from cell
To stop current and subsequent cells quietly:
class StopExecution(Exception):
def _render_traceback_(self):
pass
raise StopExecution
Slightly more "proper" options:
This will get you out of all but the worst try/except blocks.
raise KeyboardInterrupt
A little cleaner version of yours:
assert(False)
or simply:
raise
if you want to save a couple keystrokes.