Message207683
I was quite surprised by this behavior:
>>> dict() in [dict()]
True
>>> dict() in []
False
>>> dict() in dict(foo='bar').keys()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'dict'
>>> dict() in list(dict(foo='bar').keys())
False
I think it should change. Calling dict.keys() one expects to get list like behavior and not having to ensure that everything that is checked for inclusion there has to be hasheable.
If it helps, this is also a regression from python 2.6/7 where this works as expected. |
|
Date |
User |
Action |
Args |
2014-01-08 13:35:00 | dwt | set | recipients:
+ dwt |
2014-01-08 13:35:00 | dwt | set | messageid: <1389188100.33.0.555885401078.issue20190@psf.upfronthosting.co.za> |
2014-01-08 13:35:00 | dwt | link | issue20190 messages |
2014-01-08 13:34:59 | dwt | create | |
|