this post was submitted on 03 Jun 2025
493 points (99.0% liked)
Programmer Humor
23855 readers
2562 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
FINALLY! This has always annoyed me. If you’re gonna go through all the trouble of identifying that I want to exit, just DO it.
It’s not really much extra effort though
They just added so e text to the
__repr__
method on theexit
callable objectThat’s much easier than figuring out if your running this interactively and trying to figure out if this is going to break stuff.
Lemme golf that
Not that hard
repr is generally assumed to be side effect free and cheap to run, so things like debuggers tend to show repr of things in scope, including possibly
exit
also then it behaves differently between repl and script, since repr never gets run. to do it properly it has to be a new repl keyword I imagine, but I still don't know if I'm sold on the idea
Good points. You're right, it does need solved at the shell level. Glad they did so.