Goto

bartc bc at freeuk.com
Fri Dec 29 12:13:02 EST 2017


On 29/12/2017 09:52, alister wrote:
> On Thu, 28 Dec 2017 18:54:31 -0800, breamoreboy wrote:
> 
>> On Thursday, December 28, 2017 at 7:40:14 PM UTC, alister wrote:
>>> On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote:
>>>
>>>> How to use goto in python?
>>>>
>>>> ---
>>>> This email has been checked for viruses by AVG.
>>>> http://www.avg.com
>>>
>>> Dont!
>>> actually you cant - there isn't one*
>>>
>>> *at least not in the core language no doubt some sick person will have
>>> manager to hack together some sort of dodgy code to simulate it if you
>>> look hard enough)
>>>
>>>
>> This http://entrian.com/goto/ has been around for almost 14 years.
> 
> ok ill admit i didn't look at all (because goto is a silly idea &
> unnecessary)

If you want to translate code from one language to another, and the 
source language uses gotos, or uses control structures not available in 
the target language, then gotos would be very useful in the latter.

(gotos are frowned upon because they make program flow harder to see 
within a normal structured program. However examples of 'advanced' 
Python I've seen are such that I would rather contend with a few gotos.)

-- 
bartc



More information about the Python-list mailing list