[issue41272] New clause in FOR and WHILE instead of ELSE

2020-07-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I see that this was already moved to the mailing list. Am marking this as closed. If the mail list discussion proves favorable, feel free to reopen. -- nosy: +rhettinger resolution: -> later stage: -> resolved status: open -> closed __

[issue41272] New clause in FOR and WHILE instead of ELSE

2020-07-18 Thread Vedran Čačić
Vedran Čačić added the comment: I completely agree that we should reject this, but you commit a very frequent mistake in programming try-expressions. The problem is, if the first option contains a NameError, second option will be executed. It should be: try: i001 except NameError:

[issue41272] New clause in FOR and WHILE instead of ELSE

2020-07-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think this should be closed as 'rejected'. 1. I am strongly opposed to giving keywords strongly context-dependent alternate meanings. I also don't think that the proposal could be parsed. Currently, 'if' introduces a new, independent statement, and makin

[issue41272] New clause in FOR and WHILE instead of ELSE

2020-07-10 Thread Eric V. Smith
Eric V. Smith added the comment: You should bring this up on the python-ideas mailing list so that it gets more visibility. -- nosy: +eric.smith ___ Python tracker ___ __

[issue41272] New clause in FOR and WHILE instead of ELSE

2020-07-10 Thread catrudis
New submission from catrudis : 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