[Guido, on {for,while}/else] ... > The question remains whether Python would be easier to learn without > them. And if so, the question would remain whether that's offset by > their utility for experienced developers. All hard to assess > impartially! That's what I'm here for. I like loop "else" clauses, but have to admit that (a) I rarely use them; (b) most of the time I use them, my control flow is on the way to becoming so convoluted that I'm going to rewrite the whole function soon anyway; and, (c) I've often misread code that uses them, mentally attaching the "else" to a nearby "if" instead. I also suspect that if they weren't in the language already, a PEP to introduce them would fail, because still_looking = True some loop: if found it: still_looking = False break if still_looking: # what would have been in the "else" clause is clear and easy to write without it.
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