Skip to content

Commit

Permalink
preserve list subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
TomekTrzeciak committed Dec 6, 2024
1 parent 1d43c53 commit c718f8b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cylc/flow/parsec/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def replicate(target, source):
target[key].defaults_ = pdeepcopy(val.defaults_)
replicate(target[key], val)
elif isinstance(val, list):
target[key] = val[:]
target[key] = type(val)(val)
else:
target[key] = val

Expand Down Expand Up @@ -247,7 +247,7 @@ def poverride(target, sparse, prepend=False):
# Override in-place in the target ordered dict.
setitem = target.__setitem__
if isinstance(val, list):
setitem(key, val[:])
setitem(key, type(val)(val))
else:
setitem(key, val)

Expand Down Expand Up @@ -302,13 +302,9 @@ def m_override(target, sparse):
"parsec dict override: no __MANY__ placeholder" +
"%s" % (keylist + [key])
)
if isinstance(val, list):
dest[key] = val[:]
else:
dest[key] = val

if isinstance(val, list):
dest[key] = val[:]
dest[key] = type(val)(val)
else:
dest[key] = val
for dest_dict, defaults in defaults_list:
Expand Down

0 comments on commit c718f8b

Please sign in to comment.