Re: [Python-ideas] for/except/else

March 1, 2017
12:16 p.m.
On 01.03.2017 12:56, Steven D'Aprano wrote:
correct.
Right, that's how you'd likely implement the behavior today, but see my argument about the two alternative code branches not ending up together at the same level of indentation.
Just like in try/except/else, the order would be for (or while)/except/else with the difference that both except and else would be optional.
Yeah, I know that's why I listed this under cons.
- There are other ways to exit a for-loop than just break. Which of them, if any, will also run the except block?
None of them (though, honestly, I cannot think of anything but exceptions here; what do you have in mind?)
2940
Age (days ago)
2940
Last active (days ago)
0 comments
1 participants
participants (1)
-
Wolfgang Maier