Message291868
dict.pop() supports unhashable values, but dict.__contains__() and dict.get() don't:
>>> [] in {}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
>>> {}.get([], 42)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
>>> {}.pop([], 42)
42
OrderedDict.pop() also doesn't support unhashable values:
>>> collections.OrderedDict().pop([], 42)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list' |
|
Date |
User |
Action |
Args |
2017-04-19 09:41:08 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, fdrake, rhettinger, pitrou, stutzbach, donkopotamus |
2017-04-19 09:41:08 | serhiy.storchaka | set | messageid: <1492594868.33.0.660593340663.issue30100@psf.upfronthosting.co.za> |
2017-04-19 09:41:08 | serhiy.storchaka | link | issue30100 messages |
2017-04-19 09:41:08 | serhiy.storchaka | create | |
|