Added a fix for Python 3.2 which has an lru_cache that doesn't support typing.