[Baypiggies] Python way to avoid usage of raise

James Tatum jtatum at gmail.com
Wed Oct 6 05:57:03 CEST 2010

On Tue, Oct 5, 2010 at 7:15 PM, Nick S Kanakakorn <bbdada at gmail.com> wrote:
> Hi,
> My work place has imposed a rules for no use of exception (catching is
> allowed).  If I have code like this

I've seen this anti-pattern up close. There is no Pythonic answer -
exceptions are the answer. I've adapted this recipe[0] to get all
kinds of information from the call stack when something fails,
although it depends on the failing function to call it... Definitely a
pain. I feel for you. Hopefully the code is solid enough not to need
too much debugging.

For the curious, the rationale I heard is that failure isn't important
enough to stop the execution or the minor variant, failures are
irrelevant to the execution.

[0] http://code.activestate.com/recipes/52215/

More information about the Baypiggies mailing list