Exceptional inheritance patterns (was Re: [Python-Dev] Python in Unicode context) (original) (raw)

Holger Krekel pyth at devel.trillke.net
Fri Aug 6 09:45:09 CEST 2004


Greg Ewing wrote:

> My point is that I like to regard try/except as a mechanism for > "out-of-band" objects. Guidos "should be shot" seems to indicate he > sees try/except only useful/applicable to exception-handling.

If the root exception class were called something else, such as 'Raisable', would that make you feel better?

Yes, I certainly wouldn't object. I guess this would mean 'Exception' would derive from Raisable because Exception itself should probably not go away. Hey, strings could inherit from Raisable, too! Just kidding :-)

Then again, i think Python has a tradition of not requiring inheritance but just behaviour. And doesn't this whole issue only exist because "raise X" with X being a class and autoinstantiated is allowed?

Well, anyway, let's not add too much to the current python-dev traffic with this issue. I think it has been brought up a couple of times already.

Hey, i have an idea: why not create a python-syntax mailing list (or python-hell :-) ?

cheers,

Holger


More information about the Python-Dev mailing list