is there any sort of guarantee on when a parameter triggers functions that watch it?
E.g.
class A(param.Parameterized):
a = param.Number()
b = param.Number(default=0)
@param.depends('a', watch=True)
def update(self):
self.b = 999
foo = A()
foo.a = 8
print(foo.b)
Always seems to print 999. Can I rely on that, or may there be a case where the foo.update function hasn’t run yet by the time I want to access the b parameter? I went into the source code and it seemed to handle asynchronous cases as well in some way, but I’m not sure which applies when.
I can’t answer your question about asynchronicity as I’m a complete novice, but I do want to point out that there is a common case where foo.update() is not triggered when you might expect it to be, which is when you pass a to the constructor: