On 14/07/2020 04:56, Random832 wrote:
On 11/07/2020 06:22, Олег Комлев wrote:
ELSE-clause in FOR and WHILE has unclear syntax. I suggest new clause instead:
if COND:
...
[elif COND:
...]
[else:
...]
This IF-clause like must be immediately after FOR- or WHILE-cycle (only
comment allowed between). It looks like a regular IF, but COND is
special.
On Sun, Jul 12, 2020, at 00:16, Rob Cliffe via Python-ideas wrote:
Something to consider: Would it be legal to mix these CONDs with other
conditions in the 'elif' chain? E.g.
if break:
...
elif x > 0:
...
elif finally:
What if "instead of a special kind of if clause that can only be placed after a
loop", we simply defined these three special expressions [usable in any if/elif
statement] to reference special boolean flags that are set after exiting any loop?
The problem is: how long would these "special boolean flags" be retained?
Could they still be tested
100 lines of code later (assuming no other loops were executed)?
After returning from a function?
Inside a new function call?
etc.
This would violate the principle of ... I can't remember the computer
science name for it, but let's call it ... local transparency.
Rob Cliffe
_______________________________________________
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/Z76AKHQUB2DZWBB3CQGHPIHQ7WUW5BYV/
Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
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/NQCLDAZV3256FMXTPGCHRVNUSVXN7ZFT/
Code of Conduct: http://python.org/psf/codeofconduct/