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 <[email protected]>
<http://bugs.python.org/issue18510>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com