diff options
author | 2007-03-21 19:02:34 +0000 | |
---|---|---|
committer | 2007-03-21 19:02:34 +0000 | |
commit | 5c266fb891dd485b788495ec7ef4de029ada726f (patch) | |
tree | dcd77fa1d6e32d2d5c54d5f68131f6d19164a590 /demo | |
parent | (pedronis, arigo, arre) (diff) | |
download | pypy-5c266fb891dd485b788495ec7ef4de029ada726f.tar.gz pypy-5c266fb891dd485b788495ec7ef4de029ada726f.tar.bz2 pypy-5c266fb891dd485b788495ec7ef4de029ada726f.zip |
settling the tputil API to handle both virtual
and concrete proxies (the latter are instantiated
through providing an instance 'obj' and there is
convenient help to delegate operations to it,
see the tests and docstring for details)
Diffstat (limited to 'demo')
-rw-r--r-- | demo/tp-persistence.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/demo/tp-persistence.py b/demo/tp-persistence.py index c89307b459..ae8880d430 100644 --- a/demo/tp-persistence.py +++ b/demo/tp-persistence.py @@ -5,7 +5,7 @@ mechanism on top of PyPy's transparent proxies. """ from pypymagic import tproxy, get_tproxy_controller -from tputil import make_instance_proxy +from tputil import make_proxy list_changeops = set('__iadd__ __imul__ __delitem__ __setitem__ ' '__delslice__ __setslice__ ' @@ -13,11 +13,11 @@ list_changeops = set('__iadd__ __imul__ __delitem__ __setitem__ ' def make_plist(instance, storage): def perform(invocation): - res = invocation.perform() + res = invocation.delegate() if invocation.opname in list_changeops: storage.dump(instance) return res - return make_instance_proxy(instance, perform, typ=list) + return make_proxy(perform, type=list, obj=instance) def get_plist(storage): obj = storage.load() |