sys.exit() と exit()

どーでもいいことですが、Python 2.5以降では sys.exit() の代わりに exit() と書いてもプログラムが終了します。

しかしドキュメントによると

The site module (which is imported automatically during startup, except if the -S command-line option is given) adds several constants to the built-in namespace. They are useful for the interactive interpreter shell and should not be used in programs.

とのことなので、やはりプログラム中では sys.exit() と書くべきみたいですね(実際 -S オプションを付けて実行すると exit() は NameError になる)。

参考: