Lib/site.py (located under the Python root installation directory) is a module that is automatically imported during Python initialization (unless the command line option -S is specified). Lib/site-packages to the module search path. site.py has the function setquit() which defines the new(?) builtins(?) quit and exit.