MH - dicts and lists change-tracking is fixed (#2951)

* dicts and lists change-tracking is fixed

* added changelog fragment

* fixed sanity check
This commit is contained in:
Alexei Znamensky 2021-07-08 17:20:01 +12:00 committed by GitHub
commit 56acd4356f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 2 deletions

View file

@ -6,6 +6,8 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import copy
class VarMeta(object):
NOTHING = object()
@ -30,11 +32,11 @@ class VarMeta(object):
if fact is not None:
self.fact = fact
if initial_value is not self.NOTHING:
self.initial_value = initial_value
self.initial_value = copy.deepcopy(initial_value)
def set_value(self, value):
if not self.init:
self.initial_value = value
self.initial_value = copy.deepcopy(value)
self.init = True
self.value = value
return self