Re:Python goto implemented with system trace function (2017)
by varelaz on Tuesday May 05, 2020 @02:44PM
(#23083327)
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.
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.