import param
start = param.rx(1)
end = param.rx(10)
l = list(range(20))
lrx = param.rx(l)
sx = lrx[start:end]
print(sx.rx.value) # required to reproduce
start.rx.value = 4
print(sx.rx.value) # [1, 2, ...], not [4, 5, ...] !
I think that the reactive expressions of the start:endslice passed to __getitem__ were not resolved, which means that no watcher was set to invalidate the expression when start is updated. Resolving references recursively fixed the issue and broke no other test, but well, it might be a big hammer 🤔 Anyhow, I've also added another similar test that would have failed without this change, this time with a tuple containing reactive expressions passed to Numpy's __getitem__.
Attempts to fix https://github.com/holoviz/param/issues/940
Which can be reproduced with:
I think that the reactive expressions of the
start:end
slice passed to__getitem__
were not resolved, which means that no watcher was set to invalidate the expression whenstart
is updated. Resolving references recursively fixed the issue and broke no other test, but well, it might be a big hammer 🤔 Anyhow, I've also added another similar test that would have failed without this change, this time with a tuple containing reactive expressions passed to Numpy's__getitem__
.