diff --git a/param/parameterized.py b/param/parameterized.py index e43758d3d..3d49f9fad 100644 --- a/param/parameterized.py +++ b/param/parameterized.py @@ -426,6 +426,9 @@ def _f(self, obj, val): params = obj._param__private.params instance_param = None if params is None else params.get(self.name) + if (params is not None and instance_param is None): + instance_param = _instantiated_parameter(obj, self) + if instance_param is not None and self is not instance_param: instance_param.__set__(obj, val) return @@ -1404,7 +1407,7 @@ def __set__(self, obj, val): warnings.warn( 'Number.set_hook has been deprecated.', category=_ParamDeprecationWarning, - stacklevel=5, + stacklevel=6, ) self._validate(val) diff --git a/tests/testselector.py b/tests/testselector.py index 84ffffe42..1c4dc9d62 100644 --- a/tests/testselector.py +++ b/tests/testselector.py @@ -459,5 +459,4 @@ class B(A): b.p = 3 assert A.param.p.objects == [1, 2] - assert B.param.p.objects == [1, 2, 3] assert b.param.p.objects == [1, 2, 3]