Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, tup, hash_value):
super(_HashedList, self).__init__(tup)
self.hash_value = hash_value
def _make_key(args, kwargs, kwargs_mark=(object(),)):
"""
Make a cache key
"""
key = args
if kwargs:
key += kwargs_mark
for item in kwargs.items():
key += item
try:
hash_value = hash(key)
except TypeError: # process unhashable types
return str(key)
else:
return _HashedList(key, hash_value)