Source code for cutcutcodec.core.opti.cache.hashable

"""Makes the signature hashable."""

import pickle


[docs] def hashable(signature: object) -> object: """Return an hashable object.""" try: hash(signature) except TypeError: return pickle.dumps(signature) return signature