Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But really it should just exit. There's really no reason why it shouldn't.

I think telnet does something stupid along the same lines "I know you want to quit but please ask address me as Sir first".



There would be two ways to implement that, neither of which are particularly good. You could either have the exit function call itself from its __repr__ method, which an abstraction violation so egregious it introduces security vulnerabilities (imagine a logger printing repr(thing) to stderr, and someone sneaking the exit function in there for it to print), or you could special case it by making exit a reserved word, which flies in the face of the Python 3 ethos which changed print from a reserved word to a function and breaks a lot of established code.

Programming languages have rules that the programmer is expected to learn. Part of being a programmer is foregoing a certain amount of user friendliness in favor of an environment that is more powerful so that we can actually get things done. Programmers are paid to memorize and follow these rules so that the end user does not have to learn them.


You're trying to think of problems, not solutions.

It's pretty easy to think of a good solution with few enough downsides that overall the design is much better:

In the REPL only, if you type "exit" and press enter, it quits.

No changes to Python semantics required. All code still works. Much friendlier UX.

I wonder what dubious justification the Python Devs would come up with to avoid implementing that (and therefore admitting they've been wrong for 20 years). They'd probably try and claim it is more confusing to beginners or some nonsense like that.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: