[Python-Dev] dict containment annoyance (original) (raw)

Guido van Rossum guido at python.org
Mon Aug 14 03:49:29 CEST 2006


On 8/13/06, Scott Dial <scott+python-dev at scottdial.com> wrote:

FWIW, I think the logic of swallowing the TypeError is completely reasonable.

Then you haven't debugged enough Python programs.

Swallowing an exception of any kind is always a trap waiting to shut when you least expect it, because you have no control over what other operations might cause an exception.

E.g. when you write

try: hash(x) except TypeError:

apparently x is not hashable

then you're also swallowing any type errors in the computation of a legitimate hash function.

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list