Cachey produces an unhelpful div/zero error when a cached function returns a zero-length array.
Examples:
from cachey import Cache
import numpy as np
import pandas as pd
cache = Cache(1e5)
@cache.memoize
def myfunc(x):
return x
try:
myfunc(pd.Series())
except ZeroDivisionError as m:
print(m)
try:
myfunc(np.array([]))
except ZeroDivisionError as m:
print(m)
myfunc([]) #lists work fine
float division by zero
float division by zero
Out[39]:
[]