Re: How to get outer class name from an inner class?

2012-05-09 Thread Jean-Michel Pichavant
John Gordon wrote: I'm trying to come up with a scheme for organizing exceptions in my application. Currently, I'm using a base class which knows how to look up the text of a specific error in a database table, keyed on the error class name. The base class looks like this: class ApplicationExc

Re: How to get outer class name from an inner class?

2012-05-09 Thread Adam Skutt
On May 8, 4:05 pm, John Gordon wrote: > I'm trying to come up with a scheme for organizing exceptions in > my application. > > Currently, I'm using a base class which knows how to look up the text > of a specific error in a database table, keyed on the error class name. > > The base class looks li

Re: How to get outer class name from an inner class?

2012-05-09 Thread Ulrich Eckhardt
Am 08.05.2012 22:05, schrieb John Gordon: [...] > class QuestionTooShortError(ApplicationException): > """User entered a security question which is too short.""" > pass > > class QuestionTooLongError(ApplicationException): > """User entered a security question which is too long.""" >

Re: How to get outer class name from an inner class?

2012-05-08 Thread alex23
On May 9, 6:05 am, John Gordon wrote: > I'd like to group the classes underneath a parent class, like so: > > class Question(ApplicationException): > >     class TooShort(ApplicationException): >         pass > >     class TooLong(ApplicationException): >         pass > > This will make it easier

Re: How to get outer class name from an inner class?

2012-05-08 Thread Steve Howell
On May 8, 1:05 pm, John Gordon wrote: > I'm trying to come up with a scheme for organizing exceptions in > my application. > > Currently, I'm using a base class which knows how to look up the text > of a specific error in a database table, keyed on the error class name. > > The base class looks li

Re: How to get outer class name from an inner class?

2012-05-08 Thread Terry Reedy
On 5/8/2012 4:05 PM, John Gordon wrote: I'm trying to come up with a scheme for organizing exceptions in my application. Currently, I'm using a base class which knows how to look up the text of a specific error in a database table, keyed on the error class name. The base class looks like this:

Re: How to get outer class name from an inner class?

2012-05-08 Thread Chris Rebert
On Tue, May 8, 2012 at 1:05 PM, John Gordon wrote: > I'm trying to come up with a scheme for organizing exceptions in > my application. > > Currently, I'm using a base class which knows how to look up the text > of a specific error in a database table, keyed on the error class name. > > The base c

Re: How to get outer class name from an inner class?

2012-05-08 Thread John Gordon
In John Gordon writes: > class QuestionTooShortError(NetIDAppsError): > """User entered a security question which is too short.""" > pass > class QuestionTooLongError(NetIDAppsError): > """User entered a security question which is too long.""" > pass Oops! These classes inheri

How to get outer class name from an inner class?

2012-05-08 Thread John Gordon
I'm trying to come up with a scheme for organizing exceptions in my application. Currently, I'm using a base class which knows how to look up the text of a specific error in a database table, keyed on the error class name. The base class looks like this: class ApplicationException(Exception):