Skip to content

Commit

Permalink
Restore watchers handling to deal with in a separate PR
Browse files Browse the repository at this point in the history
  • Loading branch information
jbednar committed Sep 8, 2023
1 parent 6ce1ef3 commit 9ba4aa1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions param/parameterized.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,11 +1708,16 @@ def _instantiate_param_obj(paramobj, owner=None):
# Shallow-copy Parameter object, with special handling for watchers
# (from try/except/finally in Parameters.__getitem__ in https://github.com/holoviz/param/pull/306)
p = paramobj
watchers = p.watchers
p.watchers = {}
p = copy.copy(p)
try:
# Do not copy watchers on class parameter
watchers = p.watchers
p.watchers = {}
p = copy.copy(p)
except:
raise
finally:
p.watchers = {k: list(v) for k, v in watchers.items()}

p.watchers = {k: list(v) for k, v in watchers.items()}
p.owner = owner

# shallow-copy any mutable slot values other than the actual default
Expand Down

0 comments on commit 9ba4aa1

Please sign in to comment.