[issue18510] dict.__contains__ raises exception instead of returning False
Ethan Furman
report at bugs.python.org
Sat Jul 20 03:27:17 CEST 2013
Ethan Furman added the comment:
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?
----------
title: if Enum member value is not hashable an exception is raised -> dict.__contains__ raises exception instead of returning False
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18510>
_______________________________________
More information about the Python-bugs-list
mailing list