Re: Exception Handling Practices / Patterns

2013-08-24 Thread frank . ruiz
Hi Steven, Yea this is great. Thanks for the feedback. On Saturday, August 24, 2013 3:27:45 AM UTC-7, Steven D'Aprano wrote: > On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: > > > > [...] > > > * Seems like exception handing within Classes is largely avoided and is > > > typically only use

Re: Exception Handling Practices / Patterns

2013-08-24 Thread frank . ruiz
Appreciate the feedback. I was hoping to get as much perspective as possible. On Saturday, August 24, 2013 12:18:59 AM UTC-7, Dave Angel wrote: > snarf wrote: > > > > > Greetings, > > > > > > As I tread through my journey of OO I am trying to determine if there is a > > good approach for ex

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Steven D'Aprano
On Sat, 24 Aug 2013 15:57:55 -0400, Terry Reedy wrote: >> # Worst >> except: >> >> Don't use the last one, except maybe in the interactive interpreter, > > Stick with never. "except:" means the same thing as "except > BaseException:", except that the latter indicates a deliberate choice > rather

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Terry Reedy
On 8/24/2013 6:27 AM, Steven D'Aprano wrote: On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: [...] * Seems like exception handing within Classes is largely avoided and is typically only used when calling external libraries. There is certainly no rule "avoid exceptions inside classes". Method

Re: Exception Handling Practices / Patterns

2013-08-24 Thread MRAB
On 24/08/2013 11:27, Steven D'Aprano wrote: On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: [snip] * Using Exception is typically a bad. More specific the better. Yes, you should always try to catch the specific exceptions you care about: # Best except ValueError, OverflowError, ZeroDivisi

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Steven D'Aprano
On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: [...] > * Seems like exception handing within Classes is largely avoided and is > typically only used when calling external libraries. There is certainly no rule "avoid exceptions inside classes". Methods often raise exceptions to signal an error

Re: Exception Handling Practices / Patterns

2013-08-24 Thread Dave Angel
snarf wrote: > Greetings, > > As I tread through my journey of OO I am trying to determine if there is a > good approach for exception handling within classes. > > From my readings and gatherings - it seems I have found a common theme, but I > am trying to solicit from the experts. > > Here is w

Exception Handling Practices / Patterns

2013-08-23 Thread snarf
Greetings, As I tread through my journey of OO I am trying to determine if there is a good approach for exception handling within classes. >From my readings and gatherings - it seems I have found a common theme, but I >am trying to solicit from the experts. Here is what I have found (I may be