[New-bugs-announce] [issue39013] SyntaxError: 'break' outside loop for legal Expression

Artem Tepanov report at bugs.python.org
Tue Dec 10 04:48:48 EST 2019


New submission from Artem Tepanov <a.tepanov at gmail.com>:

Why I can't execute this code:

while False:
    if False:
        break
print('WTF?')
When I use repl.it or PyCharm on my work (Python 3.7) all works fine, yes I know this code looks silly, but it is a legal expression.

About CPython Interpreter:
C:\WINDOWS\system32>python
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

----------
messages: 358175
nosy: Artem Tepanov
priority: normal
severity: normal
status: open
title: SyntaxError: 'break' outside loop for legal Expression
type: compile error
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39013>
_______________________________________


More information about the New-bugs-announce mailing list