Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue38640

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:while False: break => SyntaxError: 'break' outside loop
Type:behaviorStage:resolved
Components:Interpreter CoreVersions:Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: jabesq, miss-islington, pablogsal, serhiy.storchaka
Priority:normalKeywords:3.8regression, patch

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

Pull Requests
URLStatusLinkedEdit
PR 16992mergedpablogsal,2019-10-30 11:24
PR 16993mergedmiss-islington,2019-10-30 11:53
Messages (4)
msg355700 -(view)Author: Hugo Dupras (jabesq)Date: 2019-10-30 09:48
In python 3.8 the following code raises an exception, which was not the case with previous python.```while False:    ...    break```It raises the following exception: SyntaxError: 'break' outside loop.This `while False` loop was used to temporary disable a while loop in our code base.Workaround to fix this:```enable=Falsewhile enable:    ...    break``` (or use the walrus operator)
msg355709 -(view)Author: Pablo Galindo Salgado (pablogsal)*(Python committer)Date: 2019-10-30 11:53
New changeset6c3e66a34b95fff07df0ad5086104dd637a091ce by Pablo Galindo in branch 'master':bpo-38640: Allow break and continue in always false while loops (GH-16992)https://github.com/python/cpython/commit/6c3e66a34b95fff07df0ad5086104dd637a091ce
msg355710 -(view)Author: Pablo Galindo Salgado (pablogsal)*(Python committer)Date: 2019-10-30 11:57
Thanks, Hugo Dupras for the report! :)
msg355711 -(view)Author: miss-islington (miss-islington)Date: 2019-10-30 12:11
New changesetdcb338ea1b8f14e21dde3564658b9040df996349 by Miss Skeleton (bot) in branch '3.8':bpo-38640: Allow break and continue in always false while loops (GH-16992)https://github.com/python/cpython/commit/dcb338ea1b8f14e21dde3564658b9040df996349
History
DateUserActionArgs
2022-04-11 14:59:22adminsetgithub: 82821
2019-12-10 10:57:50serhiy.storchakalinkissue39013 superseder
2019-10-30 12:11:44miss-islingtonsetnosy: +miss-islington
messages: +msg355711
2019-10-30 11:57:25pablogsalsetstatus: open -> closed
resolution: fixed
messages: +msg355710

stage: patch review -> resolved
2019-10-30 11:53:39miss-islingtonsetpull_requests: +pull_request16519
2019-10-30 11:53:29pablogsalsetmessages: +msg355709
2019-10-30 11:24:15pablogsalsetkeywords: +patch
stage: patch review
pull_requests: +pull_request16518
2019-10-30 10:17:43serhiy.storchakasetkeywords: +3.8regression
nosy: +serhiy.storchaka,pablogsal
2019-10-30 09:48:06jabesqcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp