[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Include rangeobject.h,2.16,2.17

Greg Ward gward@python.net
Sun, 8 Jul 2001 19:14:01 -0400


On 08 July 2001, Guido van Rossum said:
> Q. If an operation that failed with an AttributeError now fails with a
> TypeError (or the other way around), how important is that
> incompatibility?

I generally think of those exceptions as meaning, "You've got a bug in
your code, bozo" so I don't bother catching them (except in the main
loop of GUIs and servers, to show a big scary traceback to the poor user
or dump it in a logfile).

However, I think that AttributeError is pretty aptly used for the most
part, and I don't see a great benefit in changing an incorrect
"thing.property" to raise TypeError.

        Greg
-- 
Greg Ward - Linux geek                                  gward@python.net
http://starship.python.net/~gward/
God is real, unless declared integer.