Jul-10-2020, 07:08 PM
Here is an ersatz of downward goto
from collections import defaultdict goto = label = defaultdict( lambda: type('Goto', (Exception,), {})).__getitem__ def main(x): try: ... if x == 3: raise goto('spam') ... except label('spam'): print('Goto worked!') if __name__ == '__main__': main(3)