Author serhiy.storchaka
Recipients donkopotamus, fdrake, pitrou, rhettinger, serhiy.storchaka, stutzbach
Date 2017-04-19.09:41:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492594868.33.0.660593340663.issue30100@psf.upfronthosting.co.za>
In-reply-to
Content
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'
History
Date User Action Args
2017-04-19 09:41:08serhiy.storchakasetrecipients: + serhiy.storchaka, fdrake, rhettinger, pitrou, stutzbach, donkopotamus
2017-04-19 09:41:08serhiy.storchakasetmessageid: <1492594868.33.0.660593340663.issue30100@psf.upfronthosting.co.za>
2017-04-19 09:41:08serhiy.storchakalinkissue30100 messages
2017-04-19 09:41:08serhiy.storchakacreate