> You can backport the pure Python version of lru_cache for Python 2 (or > vendor the backport done here: > https://pypi.python.org/pypi/backports.functools_lru_cache/). > The advantage is that lru_cache is C-accelerated in Python 3.5 and > upwards...
That's a pretty big back-port. The speed also does not matter for this particular use-case: Time for the actual FFT will dominate by far. The lru_cache decorator can furthermore only limit the cache size by item count and not size in memory as the proposed solution does. I think the downsides outweigh the advantages of being able to use functionality from the stdlib. _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion