oddity from `region.get_or_create_multi`, and I created a docs bug.

Issue #83 resolved
jvanasco
created an issue

I've been working on raw data all day, and kept running into an edge-case with my unit tests regarding region's get_or_create_multi.

if a backend proxy modifies the values in the mapping dictionary it gets via an upstream call from get_or_create_multi, it will break your application. this is because the dict known as values_w_created (lines 789-797) is the same dict that is used to compute a value for for the 'get' and Python modifies that in-place.

def set_multi(self, mapping):
    """this will break if the mapping[k] is no longer a CachedValue object"""
    for (k, v) in mapping.iteritems():
        mapping[k] = self.value_encode(v)
    return self.proxied.set_multi(mapping)

def set_multi(self, mapping):
    """this will work as we encode a different dict."""
    mapping2 = {}
    for (k, v) in mapping.iteritems():
        mapping2[k] = self.value_encode(v)
    return self.proxied.set_multi(mapping2)

i'll have a pull request for the docs on ProxyBackend next week.