Vedran Čačić <ved...@gmail.com> added the comment:

> based on feedback it seems that almost everyone expects "exit" to exit

I don't, and I don't remember being asked.

Let me be clear: if exit were a Python keyword, then maybe I would expect that. 
Or at least, I could convince myself to expect that. But exit is _not_ a 
keyword, it is not even a builtin, and there is a _strong_ reason for that. One 
of Guido's many valuable insights about language design is that you shouldn't 
preclude other uses of names you find convenient for your builtins. See the 
last line of Zen of Python.

And yes, I _have_ used exit as a name for my objects (e.g. as a flag in Pygame, 
set exit = False at the beginning and exit = True somewhere in the loop when I 
find out that the game is over). Although I don't recall ever actually typing 
`exit` into Python REPL to inspect its value, I really think that scenario is 
plausible (for example, if a game exited prematurely, and I wanted to see 
whether exit was set to True prematurely, or there was some other reason), and 
it would _annoy me immensely_ if instead of showing me the status of the flag 
it would drop me out of Python.

In fact, you're proposing to use exit as a keyword, but lying about it to the 
users. If it were really so important, then it _should_ be a keyword, and at 
least I'd know that I can't use it for my variables anymore. (It's not the 
first time such a thing would happen. The same thing happened with `async` a 
few years ago.) But please don't introduce those "keywords just in a particular 
context", they are horrible from the perspective of usability.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44603>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to