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

2005-03-07 Thread Heiko Wundram
On Sunday 06 March 2005 14:26, Anthra Norell wrote: snip long goto explanation 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

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 DUE" ELSE:"WAITING FOR ACTION"}, "COIN HAS

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 of

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 I

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 other commands

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

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() --

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). Typical