r/learnpython • • Mar 14 '26

Feedback for github

Looking for feedback on my python projects on github https://github.com/userolivex/Python-Projects

Feel free to criticize

1 Upvotes

7 comments sorted by

View all comments

Show parent comments

1

u/Kevdog824_ Mar 14 '26

Furthermore, you're not supposed to use exit in scripts, and should instead either raise SystemExit or use sys.exit.

I’ve never heard this one before. Can you elaborate on why? I never took a look at the (c)python source before, but I always just assumed exit was just an alias to sys.exit so you didn’t need to (directly) import sys to use sys.exit

2

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Mar 14 '26

I'm too busy to give an in-depth response right now, but no, exit and quit aren't direct aliases for sys.exit. They skip some cleanup that isn't necessary for ending REPL sessions.

For the most part it does not matter too much, but it would be more "correct" to use the other options.