On Thu, Aug 3, 2017 at 11:18 AM, Serhiy Storchaka <storch...@gmail.com> wrote: > $ ./python -m timeit -s 'import sys; sys.modules["_functools"] = None; del > sys.modules["functools"]; from functools import lru_cache; f = > lru_cache(maxsize=None)(int)' -- 'f()' > 100000 loops, best of 5: 3.39 usec per loop
Interesting, I had tried that and it didn't work for me: $ python3.6 -m timeit -s 'import sys; sys.modules["_functools"] = None; del sys.modules["functools"]; from functools import lru_cache; f = lru_cache(maxsize=None)(int)' -- 'f()' Could not import runpy module Traceback (most recent call last): File "/usr/lib/python3.4/runpy.py", line 14, in <module> import importlib.machinery # importlib first so we can test #15386 via -m File "/usr/lib/python3.4/importlib/__init__.py", line 34, in <module> _w_long = _bootstrap._w_long AttributeError: module 'importlib._bootstrap' has no attribute '_w_long' -- https://mail.python.org/mailman/listinfo/python-list