param icon indicating copy to clipboard operation
param copied to clipboard

Deprecate `what` keyword of `watch_values`

Open maximlt opened this issue 1 year ago • 0 comments

Deprecate what keyword of .param.watch_values as anyway the only allowed value is what='value'.

    def watch_values(self_, fn, parameter_names, what='value', onlychanged=True, queued=False, precedence=0):
        """
        Easier-to-use version of `watch` specific to watching for changes in parameter values.

        Only allows `what` to be 'value', and invokes the callback `fn` using keyword
        arguments <param_name>=<new_value> rather than with a list of Event objects.
        """
        if precedence < 0:
            raise ValueError("User-defined watch callbacks must declare "
                             "a positive precedence. Negative precedences "
                             "are reserved for internal Watchers.")
        assert what == 'value'
        ...

I'm not sure I ever used watch_values, even though it looks quite handy.

maximlt avatar Jan 03 '25 15:01 maximlt