Re: GOTO (was Re: Appeal for python developers)

2005-03-07 Thread Anthra Norell
> Heiko wrote:   > SETUP = object()> ELSE = object()> BREAK = object() > > machine = {"WAITING FOR ACTION":>   {customer_drops_coin:"COIN HAS BEEN DROPPED",>    customer_selects_beverage:"ORDER RECEIVED",>    customer_cancels_order:"ACCOUNT CLOSURE IS

Re: GOTO (was Re: Appeal for python developers)

2005-03-07 Thread Heiko Wundram
On Sunday 06 March 2005 14:26, Anthra Norell wrote: > Wow, I never thought I'd say this, but this certainly is an ingenious use of goto... But, nevertheless, I don't think this is applicable to Python as a way of justifying goto in the language, as your program doesn't have a split between abs

Re: GOTO (was Re: Appeal for python developers)

2005-03-06 Thread Andrew Dalke
Paul McGuire wrote: > At the risk of beating this into the Pythonic ground, here is a > generator version which collapses the original nested loop into a > single loop, so that break works just fine: Indeed. For some things I'm still in the pre-generator days of Python. If I worked at it I think

Re: GOTO (was Re: Appeal for python developers)

2005-03-06 Thread Anthra Norell
> Please include "goto" command in future python realeses> know that proffesional programers doesn't like to use it, > but for me as newbie it's too hard to get used replacing it > with "while", "def" or other commands> -- I believe the bad reputation of 'goto' goes back to the originators

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Steven Bethard
Dennis Lee Bieber wrote: On 5 Mar 2005 08:00:23 -0800, [EMAIL PROTECTED] declaimed the following in comp.lang.python: "explicit GOTO"'. Goto's are less dangerous when they are in the forward direction, to code appearing later. UGH... That is the one direction I always avoid (in FORTRAN 77). Typica

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: Goto is useful [...] when there is a clean-up section of a function that should be executed for various error conditions. Like this? def foo(): f = open('foo.txt') try: # do stuff with f finally: f.close() -- http://mail.python.org/mailman/listin

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Paul McGuire
At the risk of beating this into the Pythonic ground, here is a generator version which collapses the original nested loop into a single loop, so that break works just fine: .def getCombinations(*args): .if len(args) > 1: .for a0 in args[0]: .for remainder in ge

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Andrew Dalke
beliavsky wrote: > Goto is useful in breaking out of a nested loop and when there is a > clean-up section of a function that should be executed for various > error conditions. But much less useful in languages like Python which have exception handling. At rare times I've needed something like fo

GOTO (was Re: Appeal for python developers)

2005-03-05 Thread beliavsky
Torsten Bronger wrote: > Hallöchen! > > BOOGIEMAN <[EMAIL PROTECTED]> writes: > > > Please include "goto" command in future python realeses I know > > that proffesional programers doesn't like to use it, but for me as > > newbie it's too hard to get used replacing it with "while", "def" > > or othe