From 8d32c2c06764ef49423b41ea248889df63d337c4 Mon Sep 17 00:00:00 2001 From: Wirawan Purwanto Date: Tue, 16 Apr 2013 11:55:18 -0400 Subject: [PATCH] * Parameters: if _flatten_ is enabled, must flatten in reverse order to give the firstly mentioned dict the priority. --- params/params_flat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/params/params_flat.py b/params/params_flat.py index 685e4bf..e4dd748 100644 --- a/params/params_flat.py +++ b/params/params_flat.py @@ -183,7 +183,7 @@ class Parameters(dict): dict.clear(self) if _opts_.get('_flatten_', False): #FIXME# if p is a Parameters object, then we must recursively flatten it too - for p in _override_dicts_: + for p in _override_dicts_[::-1]: dict.update(self, p) dict.update(self, _opts_) else: @@ -277,6 +277,8 @@ class Parameters(dict): # self._prm_[key] = value def _ActiveReadValue_(self, val): """Private subroutine for evaluating `active' members.""" + #FIXME# Value overrides specified in enclosing Parameters object instance + # cannot be searched from this (enclosed) instance. if isinstance(val, ActiveReadValue): return val(self) else: