Re: What c.l.py's opinions about Soft Exception?
- From: Mel <mwilson@xxxxxxxxxxxx>
- Date: Sun, 09 Mar 2008 07:21:54 -0400
Lie wrote:
[ ... ]
Soft Exception[ ... ]
What is "Soft Exception"?
Soft Exception is an exception that if is unhandled, pass silently as
if nothing happened. For example, if a variable turns into NoneType,
it'll raise Soft Exception that it have become NoneException,
programmers that wants to handle it can handle it with a try...except
block while programmers that doesn't care about it (or know it won't
be a problem to his code) can just leave the code as it is.
Soft Exception differs from Hard Exceptions (the regular Exception) in
a way that Hard Exception must be handled at all cost or the program
will be terminated while Soft Exception allow programmers not to
handle it if they don't want to.
Ideology Base:
- EAAP: Easier to apologize than to ask permission.
Sort of like a COME FROM statement. Drastic effects on program execution: a `raise SoftException` in the middle of a loop would break the loop if a catcher existed, or leave the loop running if not. It would really need the ability to resume after catching an exception. You can't really talk about 'apologize' around something that's so irreparable.
I'd try for this effect by creating a class of objects with well-defined callbacks.
Mel.
.
- References:
- Prev by Date: Re: Help xxx.py Program Recognition problem
- Next by Date: Re: Green's Function
- Previous by thread: Re: What c.l.py's opinions about Soft Exception?
- Next by thread: Re: What c.l.py's opinions about Soft Exception?
- Index(es):
Relevant Pages
|