def __setitem__(self, key, item): if key != item.name: raise KeyError('Key "%s" is different from variable name "%s"!' % (key, item.name)) odict.__setitem__(self, key, item) # Do not propagate id. item._set_id(None)
def __setitem__(self, key, item): if key != item.name: raise KeyError('Key "%s" is different from variable name "%s"!' % (key, item.name)) odict.__setitem__(self, key, item) # Fix id in item. item._set_id(self._id)