[Python-Dev] a quit that actually quits

Gerhard Häring gh at ghaering.de
Wed Dec 28 00:52:54 CET 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ka-Ping Yee wrote:
> [...]
> (b) If more handholding seems like a good idea, then:
>> class ExitHatch:
> def __call__(self): sys.exit()
> def __repr__(self): return '<Type "exit()" to exit Python.>'
> __builtins__.exit = __builtins__.quit = ExitHatch()

That looks like a good compromise to me.
- -- Gerhard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDsdPWdIO4ozGCH14RAsTyAKCW5mwCJ/cN+UbKICufXwmDIX9/tgCfQLJa
LaEL4a4pV7Jhnh3ry/b+CrU=
=/FQl
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /