Ejemplo n.º 1
0
 def set(self, key, value, lazy=False, allow_override=False):
     self.logger.debug('[container#{id}] {cls}.set({key!r}, {value!r})'.format(cls=type(self).__name__, id=id(self), **locals()))
     if is_reference(value):
         return self.define(key, value)
     elif lazy:
         if isinstance(value, tuple):
             return self.define(key, tuple_reference(value))
         else:
             raise NotImplementedError('Lazy logic not implemented for {0}.'.format(type(value).__name__))
     return self.set_parameter(key, value, allow_override)
Ejemplo n.º 2
0
 def assertIsReference(self, o):
     self.assertTrue(is_reference(o))