News for hackers. Stuff that matters.
Re:Microfeatures I'd like to see in more languages by cpurdy on Saturday January 07, 2023 @08:08PM (#34294923)
I hate the Python syntax using "else" for this, but I love the feature.

I've often wanted both a "then" and an "else" from both for and while loops. The "then" would be for a successful completion (no break), and the "else" would be for when the loop doesn't even run a single iteration.

But that didn't make it into our "language budget", unfortunately. It's easy to implement, but hard to argue for when it doesn't get used often

There are no comments on this comment yet.