On 15/07/2020 09:20, Dominik Vilsmeier wrote:

But `finally` with a `for` loop is redundant since the code can be placed just after the loop. For `try/except` it's a different situation since the exception might bubble up, so "normal" code after the `try` won't be reached.

+1

Also `on_break` doesn't seem really important since that code can be executed inside the loop right before the `break`.

Not true, because you might have multiple breaks.  This would avoid putting the same code after each one.

May I repeat:  Spelling 'if break:' and 'if not break:' rather than say 'on_break:' etc. would avoid adding new keywords.

I don't know what to do about the zero iterations case, though.
Best wishes
Rob Cliffe
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/CL7MOZ32JCD5WAOBPVHS4SW3GHR624RI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to