[Python-Dev] Re: changing AttributeError to TypeError

Fredrik Lundh fredrik@pythonware.com
Sun, 8 Jul 2001 14:41:23 +0200


guido wrote:

> Q. If an operation that failed with an AttributeError now fails with a
> TypeError (or the other way around), how important is that
> incompatibility?

what operations do you have in mind?  

    cd Lib
    grep "except.*\(AttributeError\|TypeError\)" *.py */*.py */*/*.py

gives me about 75 hits in the 2.0 standard library; looks like all but
one would break if you changed *all* attribute errors to type errors,
and vice versa...

if this change doesn't affect any code in the standard library,
changes are that it'll only break a few of the ~1000 uses I found
in my company's code repository...

</F>