3 ms·
I wonder what you think of "for else" loops. (although I think "else" should have been a different keyword)
by m463 7y ago
I wonder what you think of "for else" loops.
(although I think "else" should have been a different keyword)
- dagw 7y agoNot OP, but I've probably used them 2 or 3 times in the past decade or so and each time it made for a nice solution to the problem I was facing.
- tripzilch 7y agoEvery time I come across a use case when the "for else" construct would be applicable, I decide against using it just because the "else" keyword is just very unintuitive to people not familiar with this rarely used construct ... so yeah, I too wish it was a different keyword :)
- m463 7y agomaybe we will get "The 3to4 tool will automatically adapt regretfully-named-keywords when converting your sources to Python 4."