This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Luminair
Recipients Luminair, lys.nikolaou, pablogsal
Date 2022-04-02.15:22:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648912938.49.0.294266093677.issue47202@roundup.psfhosted.org>
In-reply-to
Content
Below are four examples of impossible code that operates on nothing. The latter two continue silently, throwing no errors. I saw a bug sneak by because of this. I wonder if it is within the scope of Python's design to throw Exceptions in these situations? 

x = 

for x in : print("This code is never reached")

while(None): print("This code is never reached")

emptylist = []
for x in emptylist:
    if emptylist[x] == "This code is never reached":
        print("This code is never reached")
    else: print("This code is never reached")
History
Date User Action Args
2022-04-02 15:22:18Luminairsetrecipients: + Luminair, lys.nikolaou, pablogsal
2022-04-02 15:22:18Luminairsetmessageid: <1648912938.49.0.294266093677.issue47202@roundup.psfhosted.org>
2022-04-02 15:22:18Luminairlinkissue47202 messages
2022-04-02 15:22:18Luminaircreate