How to cache slow functions with numpy.array as function parameter on Python TL;DR from numpy_lru_cache_decorator import np_cache @np_cache() def function(array): ...