On Friday 08 July 2005 04:54, Guido van Rossum wrote: > How would a PEP to *remove* this feature fare today? I'd very much prefer that we kept them. I find it a useful way to group the behaviour of the looping - this bit is the normal loop, and this bit at the end is when the loop fails/is exhausted. This is obviously for when you use it in a loop where you're looking for a certain result. And yes, you can do something similar with try/except, but I find that ugly - 'break' is the natural way to get out of a loop, not 'raise'. I find using exceptions in this way to be a sort of horrible goto-hack, and makes the code hard on the brain. (obdisclaimer: for/else gets a mention in my OSCON python tutorial, so I'd appreciate it if you _don't_ rip it out in the next month <wink>) Anthony -- Anthony Baxter <anthony at interlink.com.au> It's never too late to have a happy childhood.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4