* Parameters._flatten_(): Added workaround to avoid evaluating the
dict values while flattening the list. This is critical for avoiding evaluation of the 'active' members.
This commit is contained in:
@@ -122,6 +122,8 @@ class Parameters(dict):
|
|||||||
return dict.__getitem__(self.ref(), key)
|
return dict.__getitem__(self.ref(), key)
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return dict.__iter__(self.ref())
|
return dict.__iter__(self.ref())
|
||||||
|
def __dict_object__(self):
|
||||||
|
return self.ref()
|
||||||
|
|
||||||
def __init__(self, *_override_dicts_, **_opts_):
|
def __init__(self, *_override_dicts_, **_opts_):
|
||||||
"""
|
"""
|
||||||
@@ -332,7 +334,10 @@ class Parameters(dict):
|
|||||||
_list_ = self.__dict__["_list_"]
|
_list_ = self.__dict__["_list_"]
|
||||||
for D in _list_[::-1]:
|
for D in _list_[::-1]:
|
||||||
#FIXME# if D is a Parameters object then we must recursively flatten it too
|
#FIXME# if D is a Parameters object then we must recursively flatten it too
|
||||||
K.update([ (k,D[k]) for k in flatten_dict(D) ])
|
if isinstance(D, Parameters._self_weakref_):
|
||||||
|
K.update(D.__dict_object__())
|
||||||
|
else:
|
||||||
|
K.update(flatten_dict(D))
|
||||||
return K
|
return K
|
||||||
|
|
||||||
def _update_(self, srcdict):
|
def _update_(self, srcdict):
|
||||||
|
|||||||
Reference in New Issue
Block a user