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/2013-July/127445.html below:

[Python-Dev] dict __contains__ raises TypeError on unhashable input

[Python-Dev] dict __contains__ raises TypeError on unhashable input [Python-Dev] dict __contains__ raises TypeError on unhashable inputEthan Furman ethan at stoneleaf.us
Sat Jul 20 03:30:23 CEST 2013
http://bugs.python.org/issue18510

Commenting further:

     some_key in dict

is conceptually the same as

     some_key in dict.keys()

which /would/ return False for an unhashable key -- at least it did in 2.x; for 3.x you have to say

     some_key in list(dict.keys())

which seems like a step backwards.

Is it worth changing __contains__ and keys() to be in line with equality?

--
~Ethan~
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