[issue20190] dict() in dict(foo='bar').keys() raises

2014-01-11 Thread Martin Häcker
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. :-( --

[issue20190] dict() in dict(foo='bar').keys() raises

2014-01-09 Thread Martin Häcker
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

[issue20190] dict() in dict(foo='bar').keys() raises

2014-01-09 Thread STINNER Victor
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:

[issue20190] dict() in dict(foo='bar').keys() raises

2014-01-09 Thread Raymond Hettinger
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

[issue20190] dict() in dict(foo='bar').keys() raises

2014-01-08 Thread Martin Häcker
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 ___

[issue20190] dict() in dict(foo='bar').keys() raises

2014-01-08 Thread STINNER Victor
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