On Mon, Jul 20, 2020 at 03:22 Jonathan Fine <firstname.lastname@example.org mailto:email@example.com> wrote:
This is a continuation of my previous post to this thread.
Python's FOR ... ELSE ... , Raymond Hettinger has told us, has origins in some ideas of Don Knuth.
That’s news to me (both that it’s due to Knuth and that Raymond said so). I invented it without awareness of prior art, by reasoning about the similarity between IF and WHILE (FOR followed from WHILE).
See Raymond's video "Transforming Code into Beautiful, Idiomatic Python" at https://www.youtube.com/watch?v=OSGv2VnC0go from 15 min 50 sec to 18 min 57 sec.
On 20/07/2020 15:42, Guido van Rossum wrote:
Also, let me be clear that this feature will never be added to the language.
With respect, that seems pretty dogmatic, given that for...else is one of the most confusing features of Python. What would be so terrible about allowing, at minimum, `if not break:' as a synonym for 'else:'?
Best wishes Rob Cliffe