On 8/1/05, Delaney, Timothy (Tim) <tdelaney at avaya.com> 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...)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4