"Goto" statement in Python

Rustom Mody rustompmody at gmail.com
Thu Apr 13 13:39:24 EDT 2017


On Thursday, April 13, 2017 at 10:56:53 PM UTC+5:30, Rob Gaddi wrote:
> On 04/13/2017 10:13 AM, Rustom Mody wrote:
> > On Thursday, April 13, 2017 at 10:19:33 PM UTC+5:30, Ian wrote:
> >> On Thu, Apr 13, 2017 at 10:23 AM, Mikhail V  wrote:
> >>> Now I wonder, have we already collected *all* bells and whistles of Python
> >>> in these two examples, or is there something else for expressing trivial thing.
> >>
> >> Functions and exceptions are considered "bells and whistles"?
> >
> > People's tastes differ… violently on
> > - food
> > - music
> > - opposite sex
> >
> > What to do??
> > Ask Trump?
> > [I guess we now need a Godwin 2.0 with :s/Hitler/Trump ]
> >
> > I wonder if you noticed that you classed functions together with exceptions...
> > presumably as basic elements.
> > And that the bedrock of much contemporary computer technology — linux-kernel,
> > even (C)Python itself, viz C — does not support one of these
> >
> 
> No, C doesn't support exception handling.  As a result, handling error 
> conditions in C is a huge pain for which (forward-only) goto is often, 
> while not the only remedy, the least painful one.  Or if you've really 
> developed a need for self-harm, setjmp/longjmp.  Or, as is more 
> frequently the case in code in the wild, error conditions simply don't 
> get checked for and come as a surprise and/or segfault later on.
> 
> Python is a radically higher level language than C.  Python supports 
> different structures than C, largely and specifically so that you don't 
> have to do things in some of the error-prone ways you would do them in 
> C.  Therefore, a given task should be solved differently in Python than 
> in C.

You are answering to a different issue than I was: Sure C and python are done
differently [your point]
I was saying that if Mikhail finds exceptions (and as he later explained 
classes) as a heavy-duty solution to a control-flow issue, he has a point

> 
> I try very hard to write Python when I write Python, and to write C when 
> I write C.  And to write through the tears when I write C++.

C++ has exceptions but no gc
Haskell has gc (like python) but no exceptions
So that suggests that while desirable, both are not in the bare-minimum set

My broader point (vive la Trump) was that if we learn to actively tolerate 
people with views wildly far from ours, the world would be a better place.

So what would I say to (people like) Mikhail?
"Here's the sources mate! Fork it! And cheers!"



More information about the Python-list mailing list