[Python-3000] PEP 3100 Comments
Georg Brandl
g.brandl at gmx.net
Tue May 9 07:33:06 CEST 2006
Guido van Rossum wrote:
> Well, personally, I don't see the advantage. I don't see the point of
> having lots of different exception types that say "you made a
> programming error" in different ways, and I severely doubt the
> usefulness of being able to distinguish between those different
> failure modes at run time. Others do. I doubt that one side is able to
> convince the other side. So let's agree to disagree.
I could see an issue with something like this:
try:
# do a call that can fail with TypeError under certain conditions
do_call()
except TypeError:
# assume that the call failed
If you now make an error in do_call(), e.g. calling a function with too
many arguments, your code always assumes that the call failed.
Sure, it should be caught by unit testing, but it needs debugging anyway.
Georg
More information about the Python-3000
mailing list