Skip to content

Instantly share code, notes, and snippets.

Created July 19, 2020 16:28
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