I think this code predated functools (Python 2.5), so I'm glad to modernize it.