Skip to content

Instantly share code, notes, and snippets.

@Bachsau
Created July 19, 2020 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bachsau/22e12d4a092e3e093b9267a68bbf1b7b to your computer and use it in GitHub Desktop.
Save Bachsau/22e12d4a092e3e093b9267a68bbf1b7b to your computer and use it in GitHub Desktop.
~/.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