Martin Häcker added the comment:
Well, if that's the case, then this bug indeed can be closed. You switched from
list as the base type to set and that has to be dealt with on application side.
Still this is surprising, but there's not much that can be done.
:-(
--
Martin Häcker added the comment:
Sorry, I got the title wrong on the first try. (Already corrected).
I think the problem is that the API of dict.keys() is surprising. One gets back
something that behaves like a list, the name 'keys' suggests that it is a list
and for lists there is no
STINNER Victor added the comment:
dict.keys() has been changed 5 years ago, when Python 3 was created.
dict.keys() is now a nice read-only view of dictionary keys. When the
dictionary is updated, the view is also updated. See the
documentation:
Raymond Hettinger added the comment:
I think the problem is that the API of dict.keys() is surprising.
One gets back something that behaves like a list, the name 'keys'
suggests that it is a list and for lists there is no requirement
that their containing items need to be hasheable.
The
Changes by Martin Häcker spamfaen...@gmx.de:
--
title: dict() in dict(foo='bar') raises - dict() in dict(foo='bar').keys()
raises
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20190
___
STINNER Victor added the comment:
key in dict checks if dict has the specified key. Dictionary keys must be
hashable. Dictionaries are not hashable.
If it helps, this is also a regression from python 2.6/7 where this works as
expected.
dict.keys() return a list in Python 2, whereas it