A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-August/068218.html below:

[Python-Dev] NotHashableError? (Re: dict containment annoyance)

[Python-Dev] NotHashableError? (Re: dict containment annoyance) [Python-Dev] NotHashableError? (Re: dict containment annoyance)Greg Ewing greg.ewing at canterbury.ac.nz
Mon Aug 14 04:26:14 CEST 2006
Guido van Rossum wrote:

> 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.

Maybe it would help if there were a specific exception,
such as NotHashableError, that hash functions were
expected to raise in this situation instead of a
generic TypeError.

For backwards compatibility it could be a subclass
of TypeError.

--
Greg
More information about the Python-Dev mailing list

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