some improvements
[tiramisu.git] / tiramisu / value.py
index 22efbbb..0a25dec 100644 (file)
@@ -771,11 +771,13 @@ class Multi(list):
             raise value
         return value
 
-    def _get_validated_value(self, index):
+    def _getdefaultvalue(self, index):
         values = self._getcontext().cfgimpl_get_values()
-        return values._get_validated_value(self.opt, self.path,
-                                           True, False, True,
-                                           index=index)
+        value = values._getdefaultvalue(self.opt, self.path, True, index,
+                                        undefined, True)
+        if self.opt.impl_is_submulti():
+            value = SubMulti(value, self.context, self.opt, self.path, index)
+        return value
 
     def append(self, value=undefined, force=False, setitem=True, validate=True,
                force_permissive=False):
@@ -787,7 +789,7 @@ class Multi(list):
                                " which is a slave").format(self.opt.impl_getname()))
         index = self.__len__()
         if value is undefined:
-            value = self._get_validated_value(index)
+            value = self._getdefaultvalue(index)
         if validate and value not in [None, undefined]:
             context = self._getcontext()
             setting = context.cfgimpl_get_settings()
@@ -943,9 +945,7 @@ class SubMulti(Multi):
                 if err:
                     raise err
 
-    def _get_validated_value(self, index):
+    def _getdefaultvalue(self, index):
         values = self._getcontext().cfgimpl_get_values()
-        return values._get_validated_value(self.opt, self.path,
-                                           True, False, True,
-                                           index=index,
-                                           submulti_index=self._index)
+        return values._getdefaultvalue(self.opt, self.path, True, index,
+                                       self._index, True)