Author asmeurer
Recipients FFY00, asmeurer, eric.araujo, gregory.p.smith, jack__d, mark.dickinson, p-ganssle, pablogsal, steven.daprano, theacodes, tlalexander, veky
Date 2021-07-14.20:10:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626293451.74.0.209012919897.issue44603@roundup.psfhosted.org>
In-reply-to
Content
When talking about making exit only work when typed at the interpreter, something to consider is the confusion that it can cause when there is a mismatch between the interactive interpreter and noninteractive execution, especially for novice users. I've seen beginner users add exit() to the bottom of Python scripts, presumably because the interpreter "taught" them that you have to end with that. 

Now imagine someone trying to use exit as part of control flow 

if input("exit now? ") == "yes":
    exit

Unless exit is a full blown keyword, that won't work. And the result is yet another instance in the language where users become confused if they run across it, because it isn't actually consistent in the language model. 

There are already pseudo-keywords in the language, in particular, super(), but that's used to implement something which would be impossible otherwise. Exiting is not impossible otherwise, it just requires typing (). But that's how everything in the language works. I would argue it's a good thing to reinforce the idea that typing a variable by itself with no other surrounding syntax does nothing. This helps new users create the correct model of the language in their heads.
History
Date User Action Args
2021-07-14 20:10:51asmeurersetrecipients: + asmeurer, gregory.p.smith, mark.dickinson, eric.araujo, steven.daprano, veky, p-ganssle, pablogsal, FFY00, theacodes, jack__d, tlalexander
2021-07-14 20:10:51asmeurersetmessageid: <1626293451.74.0.209012919897.issue44603@roundup.psfhosted.org>
2021-07-14 20:10:51asmeurerlinkissue44603 messages
2021-07-14 20:10:51asmeurercreate