Exceptions are forward gotos. A "while" loop with continue and break is backward goto.
The only thing missing is break from nested while. Java has one, called break with label, one of more obscure features of language.
So, in a sense, python already does have goto.
Comments
Exceptions are forward gotos. A "while" loop with continue and break is backward goto. The only thing missing is break from nested while. Java has one, called break with label, one of more obscure features of language. So, in a sense, python already does have goto.
All control flow constructs in modern programming languages are about codifying the safe uses of goto and setjmp.
For example defer and friends are goto cleanup; and yield and exceptions are setjmp.
Sometimes a feature of a programming language is about making it really inconvenient to do something you shouldn't be doing
So rust also has goto :)