~/.pythonrc to make `exit` work without parentheses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.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