[pypy-svn] r34503 - pypy/dist/pypy/doc
fijal at codespeak.net
fijal at codespeak.net
Sat Nov 11 20:19:17 CET 2006
Author: fijal
Date: Sat Nov 11 20:19:15 2006
New Revision: 34503
Modified:
pypy/dist/pypy/doc/proxy.txt
Log:
Updated documents for name change.
Modified: pypy/dist/pypy/doc/proxy.txt
==============================================================================
--- pypy/dist/pypy/doc/proxy.txt (original)
+++ pypy/dist/pypy/doc/proxy.txt Sat Nov 11 20:19:15 2006
@@ -20,6 +20,8 @@
Suppose we want to have list which stores all operations performed on
it for later analysis. So we create a list an apropriate controller::
+ from pypymagic import transparent_proxy
+
class Controller(object):
def __init__(self, l):
self.l = l
@@ -29,10 +31,11 @@
return getattr(self.l, name)(*args, **kwargs)
l = []
c = Controller(l)
- lst = proxy(list, c.perform)
+ lst = transparent_proxy(list, c.perform)
Here, we've created original list, some random class and called magic
-``proxy`` function, which eats operation name and additional arguments.
+``transparent_proxy`` function, which eats operation name and additional
+arguments.
Important bit is that we do not need some existing object to perform
operations on, it can do whatever we like. And of course
``type(lst) is type(l)`` and ``lst is not l`` (well, the latter is not
More information about the Pypy-commit
mailing list