Re: sys.exit versus raise SystemExit
- From: Duncan Booth <duncan.booth@xxxxxxxxxxxxxxx>
- Date: 8 Jan 2007 17:48:23 GMT
Will McGugan <will@xxxxxxxxxxxxxxxxxxxxx> wrote:
wittempj@xxxxxxxxxxx wrote:
Oh I know. I was just wondering if there was some sort of subtle 'best
sys.exit() raises a SystemExit, see
http://docs.python.org/lib/module-sys.html
practice' recommendation that I wasnt aware of for using sys.exit over
raising the exception manually. In the same way that 'open' is prefered
over 'file', even though they appear to do the same thing.
'open' is preferred when you are opening a file, 'file' is preferred when
it is the type you want. That way you leave open the option to intercept
the 'open' action without interfering with tests against the type.
I guess in a similar way you should prefer the overridable sys.exit()
function rather than using the exception directly.
.
- References:
- sys.exit versus raise SystemExit
- From: Will McGugan
- Re: sys.exit versus raise SystemExit
- From: wittempj@xxxxxxxxxxx
- Re: sys.exit versus raise SystemExit
- From: Will McGugan
- sys.exit versus raise SystemExit
- Prev by Date: Re: where is python on linux?
- Next by Date: Re: popen, Pipes with programs that expect user input
- Previous by thread: Re: sys.exit versus raise SystemExit
- Next by thread: creating simple Python scripting interfaces via C++
- Index(es):
Relevant Pages
|