def make_persistent_set():
    # TODO: transparently diff and persist this.
    backend_attr = '__%s' % hex(random.getrandbits(128))
    def _getter(self):
        if not hasattr(self, backend_attr):
            setattr(self, backend_attr, set())
        return getattr(self, backend_attr)
    def _setter(self, value):
        value = set(convert_iterable(entry, tuple) for entry in value)
        setattr(self, backend_attr, value)
    return property(_getter, _setter)
dataset/ETHPy150Open ebroder/anygit/anygit/backends/mongodb.py/make_persistent_set/original