MCPcopy Create free account
hub / github.com/ActiveState/code / sync_proxy

Function sync_proxy

recipes/Python/496742_ShelfProxy/recipe-496742.py:71–78  ·  view source on GitHub ↗
(proxy)

Source from the content-addressed store, hash-verified

69
70
71def sync_proxy(proxy):
72 if object.__getattribute__(proxy, "_invalidated"):
73 raise InvalidationError("the proxy has been invalidated (the key was reassigned)")
74 shelf = object.__getattribute__(proxy, "_shelf")
75 key = object.__getattribute__(proxy, "_key")
76 obj = object.__getattribute__(proxy, "_obj")
77 shelf[key] = obj
78 shelf.sync()
79
80def open(*args):
81 return ShelfWrapper( shelve.open(*args) )

Callers 3

__del__Method · 0.85
syncMethod · 0.85
recipe-496742.pyFile · 0.85

Calls 3

InvalidationErrorClass · 0.85
__getattribute__Method · 0.45
syncMethod · 0.45

Tested by

no test coverage detected