On 05May2009 23:28, Lawrence D'Oliveiro <[email protected]_zealand>
wrote:
| In message <[email protected]>, Gabriel
| Genellina wrote:
|
| > I prefer to put the code inside a function, and just `return` earlier.
|
| It would be nice if Python offered a straightforward equivalent to
|
| ... initialization goes here ...
| do /*once*/
| {
| ... do stuff ...
| if (check1_failed)
| break;
| ... do more stuff ...
| if (check2_failed)
| break;
| ... do even more stuff ...
| }
| while (false);
| ... cleanup goes here ...
while True:
... do stuff ...
if check1_failed:
break;
... do more stuff ...
if check2_failed:
break;
... do even more stuff ...
break
... cleanup goes here ...
Seems more straightforward to me!
And there's always try/except and context managers.
Cheers,
--
Cameron Simpson <[email protected]> DoD#743
http://www.cskk.ezoshosting.com/cs/
So why can't we celebrate November 5th the way Guy Fawkes would've wanted?
- Mike Holmes <[email protected]>
--
http://mail.python.org/mailman/listinfo/python-list