Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue39013

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:SyntaxError: 'break' outside loop for legal Expression
Type:compile errorStage:resolved
Components:Versions:Python 3.8
process
Status:closedResolution:duplicate
Dependencies:Superseder: while False: break => SyntaxError: 'break' outside loop
View:38640
Assigned To:Nosy List: Artem Tepanov, steven.daprano, xtreak
Priority:normalKeywords:

Created on2019-12-10 09:48 byArtem Tepanov, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Messages (7)
msg358175 -(view)Author: Artem Tepanov (Artem Tepanov)Date: 2019-12-10 09:48
Why I can't execute this code:while False:    if False:        breakprint('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>pythonPython 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.
msg358176 -(view)Author: Steven D'Aprano (steven.daprano)*(Python committer)Date: 2019-12-10 09:56
I don't know, why *can't* you execute that code? It works fine for me. Although I'm not using the exact same version of 3.8 that you are using.Could you copy and paste (not a screen shot or photo!) the text of your interactive session, including the error that you get, please?
msg358177 -(view)Author: Artem Tepanov (Artem Tepanov)Date: 2019-12-10 10:40
Using cmd:C:\Users\ATepanov>python -VPython 3.8.0C:\Users\ATepanov>python C:\Users\ATepanov\Desktop\Outside_The_Loop.py  File "C:\Users\ATepanov\Desktop\Outside_The_Loop.py", line 3    break    ^SyntaxError: 'break' outside loopIn Interactive:Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> while False:...     break...  File "<stdin>", line 2SyntaxError: 'break' outside loop>>>
msg358178 -(view)Author: Artem Tepanov (Artem Tepanov)Date: 2019-12-10 10:44
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> while False:...     if False:...         break...  File "<stdin>", line 3SyntaxError: 'break' outside loop
msg358179 -(view)Author: Karthikeyan Singaravelan (xtreak)*(Python committer)Date: 2019-12-10 10:49
This seems to be same asissue38640 . Can you please try 3.8.1RC1 to see if it's fixed?https://www.python.org/downloads/release/python-381rc1/
msg358180 -(view)Author: Artem Tepanov (Artem Tepanov)Date: 2019-12-10 11:07
Thx, after upgrade to:Python 3.8.1rc1 (tags/v3.8.1rc1:b00a2b5, Dec 10 2019, 01:13:53) [MSC v.1916 64 bit (AMD64)] on win32All works fine,...but Could you "pushing the person" which responsible for Web-Site please?, because I got Interpreter from there:https://www.python.org/downloads/release/python-380/Without any Warnings or Recommendation for using 3.8.1rc1Is it normal?
msg358183 -(view)Author: Karthikeyan Singaravelan (xtreak)*(Python committer)Date: 2019-12-10 12:07
Thanks for the confirmation. The issue was found after 3.8.0 release. The fix is in 3.8.1RC1 and will be made as 3.8.1 in couple of weeks. Normally regressions are not listed at downloads page but are tagged as regression in the tracker like the one linked. You can wait for sometime to use 3.8.1 which should fix the issue.
History
DateUserActionArgs
2022-04-11 14:59:24adminsetgithub: 83194
2019-12-10 12:07:15xtreaksetmessages: +msg358183
2019-12-10 11:07:07Artem Tepanovsetmessages: +msg358180
2019-12-10 10:57:50serhiy.storchakasetstatus: open -> closed
superseder:while False: break => SyntaxError: 'break' outside loop
resolution: duplicate
stage: resolved
2019-12-10 10:49:47xtreaksetnosy: +xtreak
messages: +msg358179
2019-12-10 10:44:15Artem Tepanovsetmessages: +msg358178
2019-12-10 10:40:23Artem Tepanovsetmessages: +msg358177
2019-12-10 09:56:00steven.dapranosetnosy: +steven.daprano
messages: +msg358176
2019-12-10 09:48:48Artem Tepanovcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp