I haven\'t seen an established way to memoize a function that takes key-word arguments, i.e. something of type
def f(*args, **kwargs)
since
It's similar to what EMS said, but the best way would be:
key = cPickle.dumps((*args, **kwargs))
I've been doing a lot of research and testing for memorization with decorators, and this is the best method I've found so far.