Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49245 > unrolled thread

Is this PEP-able? fwhile

Started byjimjhb@aol.com
First post2013-06-25 12:39 -0400
Last post2013-06-26 06:59 -0700
Articles 5 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  Is this PEP-able? fwhile jimjhb@aol.com - 2013-06-25 12:39 -0400
    Re: Is this PEP-able? fwhile Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-26 12:33 +0000
      Re: Is this PEP-able? fwhile rusi <rustompmody@gmail.com> - 2013-06-26 06:14 -0700
      Re: Is this PEP-able? fwhile Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-26 23:29 -0400
    Re: Is this PEP-able? fwhile rusi <rustompmody@gmail.com> - 2013-06-26 06:59 -0700

#49245 — Is this PEP-able? fwhile

Fromjimjhb@aol.com
Date2013-06-25 12:39 -0400
SubjectIs this PEP-able? fwhile
Message-ID<mailman.3884.1372243291.3114.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On Tuesday, June 25, 2013 9:30:54 PM UTC+5:30, Ian wrote:
> In my experience the sorts of people who preach "one exit point" are
> also all about defining preconditions and postconditions and proving
> that the postconditions follow from the preconditions.  I think that
> the two are linked, because the "one exit point" rule makes those
> sorts of proofs simpler.

Ah! utopia!

For every one who knows about pre/post/invariant conditions, there are 10 who follow goto-statement-is-harmful like a religious edict.



I just checked and MISRA-C 2012 now allows gotos in specific, limited circumstances.  I think it was the MISRA-C 1998 standard that caused all this trouble.  So if MISRA now allows goto, why not Python????  :)


[toc] | [next] | [standalone]


#49252

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-06-26 12:33 +0000
Message-ID<51cadfa2$0$29999$c3e8da3$5496439d@news.astraweb.com>
In reply to#49245
On Tue, 25 Jun 2013 12:39:53 -0400, jimjhb wrote:

> I just checked and MISRA-C 2012 now allows gotos in specific, limited
> circumstances.  I think it was the MISRA-C 1998 standard that caused all
> this trouble.  So if MISRA now allows goto, why not Python????  :)

[humour]
You can! Just use the goto module. It supports both GOTO and COMEFROM:

http://entrian.com/goto/

[/humour]



But seriously... GOTO works best in low-level languages. It is not very 
well suited for high-level languages like Python. Nevertheless, Python 
does support a very limited number of flow control statements which are 
like GOTO in some ways: `break` and `continue` for jumping out of loops, 
and exceptions which are cheap enough to be used as flow control.

You cannot jump into the middle of a function, or to an arbitrary line, 
or into a loop. But this is a good thing -- languages that allow 
unrestricted flow control end up with unmaintainable spaghetti code.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#49255

Fromrusi <rustompmody@gmail.com>
Date2013-06-26 06:14 -0700
Message-ID<5740cd6d-698f-4960-97d6-bf266174bc70@googlegroups.com>
In reply to#49252
On Wednesday, June 26, 2013 6:03:39 PM UTC+5:30, Steven D'Aprano wrote:
> On Tue, 25 Jun 2013 12:39:53 -0400, jimjhb wrote:
> 
> 
> 
> > I just checked and MISRA-C 2012 now allows gotos in specific, limited
> 
> > circumstances.  I think it was the MISRA-C 1998 standard that caused all
> 
> > this trouble.  So if MISRA now allows goto, why not Python????  :)
> 
> 
> 
> [humour]
> You can! Just use the goto module. It supports both GOTO and COMEFROM:
> [/humour]

Comefrom + inverted inheritance !
Are we ready for a new pep?
 

[toc] | [prev] | [next] | [standalone]


#49296

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2013-06-26 23:29 -0400
Message-ID<mailman.3912.1372303793.3114.python-list@python.org>
In reply to#49252
On 26 Jun 2013 12:33:39 GMT, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> declaimed the following:

>You cannot jump into the middle of a function, or to an arbitrary line, 
>or into a loop. But this is a good thing -- languages that allow 
>unrestricted flow control end up with unmaintainable spaghetti code.

	I once encountered something like (F77):

	if condition1 then
		some computation
		if condition2 goto 1000
 2000	continue
		more computations
	else
		another computation
		if condtion3 goto 2000
 1000	continue
		last computations
	end if

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#49257

Fromrusi <rustompmody@gmail.com>
Date2013-06-26 06:59 -0700
Message-ID<c5afa9e5-b383-400e-b1c3-c65681c80880@googlegroups.com>
In reply to#49245
On Tuesday, June 25, 2013 10:09:53 PM UTC+5:30, jim...@aol.com wrote:
> I just checked and MISRA-C 2012 now allows gotos in specific, limited 
> circumstances.  I think it was the MISRA-C 1998 standard that caused all this 
> trouble.  So if MISRA now allows goto, why not Python????  :)

Not sure who is joking and who serious in this thread.

As for who started the 'goto-trouble' it was 30 years before 1998
http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web