A RetroSearch Logo

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

Search Query:

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

[Python-Dev] dict containment annoyance

[Python-Dev] dict containment annoyanceAahz aahz at pythoncraft.com
Sat Aug 12 15:48:26 CEST 2006
On Sat, Aug 12, 2006, tomer filiba wrote:
>
> >>>a={1:2, 3:4}
> >>>[] in a
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> TypeError: list objects are unhashable
> >>>
> 
> imo, the expression should just evaluate to False instead of raising an
> exception.

-1

This is seriously no different from an attempt to do

>>> a = {}
>>> a[ [] ] = 1
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it."  --Brian W. Kernighan
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