@@ -619,7 +619,7 @@ def _params_depended_on(minfo, dynamic=True, intermediate=True):
619619 deps , dynamic_deps = [], []
620620 dinfo = getattr (minfo .method , "_dinfo" , {})
621621 for d in dinfo .get ('dependencies' , list (minfo .cls .param )):
622- ddeps , ddynamic_deps = (minfo .inst or minfo .cls ).param ._spec_to_obj (d , dynamic , intermediate )
622+ ddeps , ddynamic_deps = (minfo .cls if minfo . inst is None else minfo .inst ).param ._spec_to_obj (d , dynamic , intermediate )
623623 dynamic_deps += ddynamic_deps
624624 for dep in ddeps :
625625 if isinstance (dep , PInfo ):
@@ -1859,7 +1859,7 @@ def _update_deps(self_, attribute=None, init=False):
18591859 init_methods .append (m )
18601860 elif dynamic :
18611861 for w in obj ._dynamic_watchers .pop (method , []):
1862- (w .inst or w . cls ).param .unwatch (w )
1862+ (w .cls if w . inst is None else w . inst ).param .unwatch (w )
18631863 else :
18641864 continue
18651865
@@ -1894,7 +1894,7 @@ def _resolve_dynamic_deps(self, obj, dynamic_dep, param_dep, attribute):
18941894 subobj = getattr (subobj , subpath .split (':' )[0 ], None )
18951895 subobjs .append (subobj )
18961896
1897- dep_obj = ( param_dep .inst or param_dep .cls )
1897+ dep_obj = param_dep .cls if param_dep . inst is None else param_dep .inst
18981898 if dep_obj not in subobjs [:- 1 ]:
18991899 return None , None , param_dep .what
19001900
@@ -1930,7 +1930,7 @@ def _watch_group(self_, obj, name, queued, group, attribute=None):
19301930 on the old subobject and create watchers on the new subobject.
19311931 """
19321932 dynamic_dep , param_dep = group [0 ]
1933- dep_obj = ( param_dep .inst or param_dep .cls )
1933+ dep_obj = param_dep .cls if param_dep . inst is None else param_dep .inst
19341934 params = []
19351935 for _ , g in group :
19361936 if g .name not in params :
0 commit comments