Created
July 19, 2020 16:28
-
-
Save Bachsau/22e12d4a092e3e093b9267a68bbf1b7b to your computer and use it in GitHub Desktop.
~/.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