Difference between changing bound value from parameter and textport

I have a simple extension that defines one dependable integer foo

I want to have a bit of logic before you can set it’s value. So I have something like this:

@getter
def Foo(self):
    return self._foo

@Foo.setter
def Foo(self, val):
    if val > 5:
        print("value is too big!")
        self._foo.val = 5
    else:
        self._foo.val = val

This works as expected if I type something like this in the textport:

op('/project1/base1').Foo = 10
>>> value is too big!
op('/project1/base1').Foo
>>> tdu.Dependency... value 5 (don't remember exact output :)

But if I have a custom parameter bound to that dependable value, then when I set it to, say, 8 it gets set to 8 in both custom parameter and on the extension. I would expect maybe ui goes to 8 for a split second but then immediately bounces back to 5

Unfortunately you can’t use dependencies that way. It is in the plan for the future, but hasn’t been implemented.

Basically, your parameter is bound to _foo, not Foo, so it never goes through your setter function.