This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author catrudis
Recipients catrudis
Date 2020-07-10.20:44:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594413840.56.0.248219439277.issue41272@roundup.psfhosted.org>
In-reply-to
Content
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.
COND may be "break", "pass" or "finally". "if break:" - if used break-operator to exit cycle. "if pass:" - cycle executed 0 times. "if finally:" - cycle executed 0 or more times ("pass-case"  is included in "finally-case"). For compatibility only "else:" means "if finally:".
It's compatible enhancement. No new keyword. There can be no combination "break", "pass" or "finally" after "if"/"elif:" in current version.
History
Date User Action Args
2020-07-10 20:44:00catrudissetrecipients: + catrudis
2020-07-10 20:44:00catrudissetmessageid: <1594413840.56.0.248219439277.issue41272@roundup.psfhosted.org>
2020-07-10 20:44:00catrudislinkissue41272 messages
2020-07-10 20:44:00catrudiscreate