jayferd/python-cache — pull request #2 by jwmerrill (2012-08-13 22:34:16+00:00)
Title: Hash arguments list more robustly.

Apparently, python's hash() function does not return consistent results across python sessions. It's useful to be able to cache calls in one process and read them in another, so that's a problem. To get consistent hashes, use pickle.dumps to get a string representation of arguments, and hashlib.md5 to hash the result.

Note that pickle could be made faster by specifying a 2nd parameter at the expense of losing compatibility with older versions of python. http://docs.python.org/library/pickle.html