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
That just gave me the idea that it would be fun to inspect
exit
a little.Which led me down this path:
Okay, cool, the "Use exit() etc." blurb appears because it's the function's
repr
, and the string is assembled from itsname
andeof
properties.Now let's try to make our own:
Oh Python, you shouldn't have.
Beauty!
It never occurred me to inspect this, nice find.
Obviously they need to make
exit
's repr method raise aSystemExit
Does gtfo() then work as expected?
Yup
Nice!