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.

classification
Title: Add "elif" to "for_stmt" and "while_stmt"
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: later
Dependencies: Superseder:
Assigned To: Nosy List: moff4, rhettinger
Priority: normal Keywords: patch

Created on 2019-12-14 20:27 by moff4, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17610 closed moff4, 2019-12-14 20:48
Messages (2)
msg358406 - (view) Author: Andrey (moff4) * Date: 2019-12-14 20:27
Add an ability to use "elif" in for statement and while statement besides "else"

Example
Now:
```python3
for i in range(j):
    ...
else:
    if i > 5:
        ...
    else:
        ...
```
Shall be:
```python3
for i in range(j):
    ...
elif i > 5:
    ...
else:
    ...
```
msg358407 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-12-14 21:03
Changes to the language syntax usually require extensive discussion and a PEP.

To move forward, your next step would be to launch a discussion on the python-ideas newsgroup.  If the idea advances to an approved PEP, this tracker issue can be re-opened.
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83230
2019-12-14 21:03:31rhettingersetstatus: open -> closed

components: + Interpreter Core, - Build

nosy: + rhettinger
messages: + msg358407
resolution: later
stage: patch review -> resolved
2019-12-14 20:48:25moff4setkeywords: + patch
stage: patch review
pull_requests: + pull_request17082
2019-12-14 20:27:23moff4create