New submission from Andre Roberge <andre.robe...@gmail.com>:

Given the following code containing no if expression (only if statements):

if True:
    print('hello'

if 2:
    print(123))

The following traceback is generated in Python 3.10.0RC1

  File "...\example.py", line 2
    print('hello'
          ^^^^^^^
SyntaxError: expected 'else' after 'if' expression

----------
components: Parser
messages: 398989
nosy: aroberge, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: SyntaxError: New message "expected 'else' after 'if' expression" wrongly 
shown
versions: Python 3.10

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

Reply via email to