By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

Multiple inheritence for exceptions?

P: n/a
Useful or a bad idea?

I have a module that defines a number of exceptions which inherit from
various built-ins like KeyError, ValueError etc. I'm considering defining
an abstract module exception like MyModuleError, and having all my real
exceptions inherit from it as well, but I don't recall seeing that done
before and I was wondering if it were a bad idea for some reason.
--
Steven.

Jun 3 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Steven D'Aprano <st***@REMOVE.THIS.cybersource.com.auwrote:
Useful or a bad idea?

I have a module that defines a number of exceptions which inherit from
various built-ins like KeyError, ValueError etc. I'm considering defining
an abstract module exception like MyModuleError, and having all my real
exceptions inherit from it as well, but I don't recall seeing that done
before and I was wondering if it were a bad idea for some reason.
I often do exactly what you propose, and I believe I have suggested it
in the Nutshell 2nd edition. I have never observed bad effects.
Alex
Jun 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.