This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version":"2.0", | |
"metadata":{ | |
"apiVersion":"2006-03-01", | |
"checksumFormat":"md5", | |
"endpointPrefix":"s3", | |
"globalEndpoint":"s3.amazonaws.com", | |
"protocol":"rest-xml", | |
"serviceAbbreviation":"Amazon S3", | |
"serviceFullName":"Amazon Simple Storage Service", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyDict(dict): | |
def __hash__(self): | |
return hash(frozenset(self)) | |
key = MyDict(a=1) | |
mapping = {key: 'foo'} | |
key['b'] = 2 | |
mapping[key] # KeyError: {'a': 1, 'b': 2} | |
# Do you expect that variable which you have added to dict would raise KeyError? |