'converts mutables to Saver* variants and assigns ._parent property'

def _convert_mutables(self, data):

    def process_tree(item, parent):
        'recursively    populate    the    tree,    storing    parents'
        dtype = type(item)
        if (dtype in (basestring, int, float, bool, tuple)):
            return item
        elif (dtype == list):
            dat = _SaverList(_parent=parent)
            dat._data.extend((process_tree(val, dat) for val in item))
            return dat
        elif (dtype == dict):
            dat = _SaverDict(_parent=parent)
            dat._data.update(((key, process_tree(val, dat)) for (key, val) in item.items()))
            return dat
        elif (dtype == set):
            dat = _SaverSet(_parent=parent)
            dat._data.update((process_tree(val, dat) for val in item))
            return dat
        return item
    return process_tree(data, self)
