4 ms·
It's fairly easy to implement goto using exceptions. At least it will be all pythonic (I don't think it will become less ugly). So I don't know why this impleme
by varelaz 6y ago
It's fairly easy to implement goto using exceptions. At least it will be all pythonic (I don't think it will become less ugly). So I don't know why this implementation has to be considered at all.
How to do this: create your ExceptionGoTo class which will be handled on high level function and add callback as exception parameter, in catch you can call it.
I'm not saying that it will be exactly goto to certain line, but logically it will behave as you suppose to use goto.