Skip to content

Instantly share code, notes, and snippets.



Created Jul 19, 2020
What would you like to do?
~/.pythonrc to make `exit` work without parentheses
# ~/.pythonrc
# -*- coding: utf-8 -*-
# Make `exit` work without parentheses
import sys
if "site" in sys.modules:
Quitter = type(exit)
Quitter.__str__ = Quitter.__repr__
Quitter.__repr__ = Quitter.__call__
del Quitter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.