You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Python language parser does not properly indent else clause in for and while loops #1363
It seems the Python parser does not correctly handle for/else loops and while/else loops, particularly with respect to indentation in nested blocks.
Admittedly, I myself only just found this out but turns out an else clause in a while or for loop is valid Python code (see docs and examples) so I believe the Python parser should handle it appropriately and indent else clauses the same as it does with a matching if statement.
Activity
marijnh commentedon Mar 28, 2024
Attached patch adds indentation logic that should handle this.