On 8/1/05, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote:
> Nick Coghlan wrote:
> 
> > +-- Exception (formerly StandardError)
> >      +-- AttributeError
> >      +-- NameError
> >          +-- UnboundLocalError
> >      +-- RuntimeError
> >          +-- NotImplementedError
> 
> Time to wade in ...
> 
> I've actually been wondering if NotImplementedError should actually be a
> subclass of AttributeError.
> 
> Everywhere I can think of where I would want to catch
> NotImplementedError, I would also want to catch AttributeError. My main
> question is whether I would want the reverse to also be true - anywhere
> I want to catch AttributeError, I would want to catch
> NotImplementedError.
> 
> Perhaps instead it should be the other way around - AttributeError
> inherits from NotImplementedError. This does make some kind of sense -
> the attribute hasn't been implemented.
> 
> Both seem to have some advantages, but neither really feels right to me.
> Thoughts?

The problem with subclassing NotImplementedError is you need to
remember it is used to signal that a magic method does not work for a
specific type and thus should try the __r*__ version.  That is not a
case, I feel, that has anything to do with attributes but
implementation support.

I am not going to subclass NotImplementedError unless a huge push for
it in a very specific direction.

-Brett (who is waiting on a PEP number...)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to