On 7/25/2020 3:11 PM, Christopher Barker wrote:
On Sat, Jul 25, 2020 at 4:39 AM Eric V. Smith <[email protected]
<mailto:[email protected]>> wrote:
But all of these always make me wonder about a return inside the
suite.
Does the "else" part execute (answer: no). So as a rule, I avoid the
construct entirely,
really? does an if-else clause execute if there's a return in the if?
no. why would this be any more confusing?
Because I always remember "for ... else" has something to do with
leaving the loop early, but I don't recall if it's more like try ...
finally, or if it's related to the loop exiting early, or the loop not
exiting early, or something else I can't recall.
So, the answer to your "really?" question is "yes".
Eric
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/NSFBD2VC5VTRQ6FWMNT3C3OKDH7HTYGP/
Code of Conduct: http://python.org/psf/codeofconduct/