Consider
def L(n,k):
if n==k: return 1
if k<0 or k>n: return 0
return L(n-1,k-1)+(n+k-1)*L(n-1,k)
print parent(L)
matrix(ZZ, 8, L)
This works. However, as soon as I decorate the above function L with the very reasonable "@CachedFunction" I receive an ValueError: "Invalid matrix constructor".