New submission from theeshallnotknowethme <nohackingofkrow...@gmail.com>:

While fixing errors in a program, I encountered this:

if a == b + 2:
    c = sqrt(b) + a**2
    elif a == b + 3:
    ^^^^
SyntaxError: Invalid syntax

It should be giving an `IndentationError` or a better error message at least.

----------
components: Parser
messages: 405990
nosy: February291948, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: `elif` inside `if` block is a `SyntaxError`
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45759>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to