This feels like GOTO, ngl.

It literally is goto, but contained in a while True loop, somehow making it good. The only thing that makes this better than goto, is the fact that each "label" is contained within an if statement, but even then, it is bad.

I believe what you are trying to achieve, is branching. If you were trying to make a sort of choose-your-own-adventure game, I would understand why you would go for this approach, but nonetheless, it is a code smell, after a while, you will have hundreds of if statements. If you had a good IDE, it would be screaming at you for this.

A better alternative would be making a state machine, with each state defined as a function... but even that is bad. Why? The same exact reason that goto is bad. You're abusing functions to make way for paths, the exact thing that goto was designed to do, and yet it got marked as a thing to avoid.

I believe it goes down to what you a are trying to do in the first place. Simply put, branching. The user decides to do one thing, that thing is done, and you can navigate through a set of "branches". Well, in reality, that is the problem.

Python has horrible support for threading. That is because Python isn't supposed to do that. It's the same reason goto wasn't included in the Standard Library, even though people wanted it do be.

/r/learnpython Thread